unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* EXIT_* for `main' return value, #include <stdlib.h>
@ 2003-12-19 15:40 Thien-Thi Nguyen
  2003-12-19 16:47 ` Jason Rumney
  0 siblings, 1 reply; 3+ messages in thread
From: Thien-Thi Nguyen @ 2003-12-19 15:40 UTC (permalink / raw)


lib-src/make-docfile.c `main' function returns zero to indicate
success.  this must be handled differently under vms, for which zero
means failure.  i'd like to convert this to the construct:

  #include <stdlib.h>

  main (...)
  {
    int err_count = 0;
    ...
    return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
  }

(likewise for any other `main' return values in lib-src/*.c.)  this
makes use of EXIT_* abstractions found in stdlib.h.

my question: is "#include <stdlib.h>" ok for other platforms besides
vms and unixoids?  my doubt arises because i see such an #include in
lib-src/make-docfile.c for WINDOWSNT but not for MSDOS and have no
experience (worth remembering ;-) working on those platforms.  and
how about DOS_NT and macintosh?

thi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: EXIT_* for `main' return value, #include <stdlib.h>
  2003-12-19 15:40 EXIT_* for `main' return value, #include <stdlib.h> Thien-Thi Nguyen
@ 2003-12-19 16:47 ` Jason Rumney
  2003-12-20 15:28   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Rumney @ 2003-12-19 16:47 UTC (permalink / raw)
  Cc: emacs-devel

Thien-Thi Nguyen wrote:

>my question: is "#include <stdlib.h>" ok for other platforms besides
>vms and unixoids?
>
It should be OK for any platform with a standard C library.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: EXIT_* for `main' return value, #include <stdlib.h>
  2003-12-19 16:47 ` Jason Rumney
@ 2003-12-20 15:28   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2003-12-20 15:28 UTC (permalink / raw)
  Cc: ttn, emacs-devel

> Date: Fri, 19 Dec 2003 16:47:03 +0000
> From: Jason Rumney <jasonr@gnu.org>
> 
> >my question: is "#include <stdlib.h>" ok for other platforms besides
> >vms and unixoids?
> >
> It should be OK for any platform with a standard C library.

Right.

In particular, both MS-DOS and MS-Windows builds have that header in
any toolkit that can be used to build Emacs.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-20 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-19 15:40 EXIT_* for `main' return value, #include <stdlib.h> Thien-Thi Nguyen
2003-12-19 16:47 ` Jason Rumney
2003-12-20 15:28   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).