home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16805 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  972 b 

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
  2. From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to use 'return' in c?
  5. Message-ID: <1992Nov19.182158.8554@klaava.Helsinki.FI>
  6. Date: 19 Nov 92 18:21:58 GMT
  7. References: <1992Oct29.025437.9289@nuscc.nus.sg> <1992Oct29.053625.24495@u.washington.edu> <RQ282FK@math.fu-berlin.de>
  8. Organization: University of Helsinki
  9. Lines: 21
  10.  
  11. rene@hamel.uucp (Rene Mueller) writes:
  12. >There are a lot of compilers where [EXIT_SUCCESS and EXIT_FAILURE
  13. >don't] exist...
  14.  
  15. So then you add 
  16.  
  17.     #ifndef EXIT_SUCCESS
  18.     #define EXIT_SUCCESS 0
  19.     #endif
  20.  
  21.     #ifndef EXIT_FAILURE
  22.     #define EXIT_FAILURE 1
  23.     #endif
  24.  
  25. to port.h or whatever.  This way you can make your code more close to
  26. the standard without hurting portability.  Using explicit exit(1)'s
  27. hurts portability as well.
  28.  
  29. --
  30. Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  31.    MS-DOS, you can't live with it, you can live without it.
  32.