emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EXIT_* for `main' return value, #include <stdlib.h>


From: Thien-Thi Nguyen
Subject: EXIT_* for `main' return value, #include <stdlib.h>
Date: Fri, 19 Dec 2003 16:40:02 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]