Detection of stdio.h in gmp.h

Patrick Pelissier Patrick.Pelissier at loria.fr
Fri Oct 17 11:30:47 CEST 2003


Hello,

  To detect if stdio.h is already defined in GMP, you use this code (in 
gmp.h):

#if defined (FILE)                                              \
   || defined (H_STDIO)                                          \
   || defined (_H_STDIO)               /* AIX */                 \
   || defined (_STDIO_H)               /* glibc, Sun, SCO */     \
   || defined (_STDIO_H_)              /* BSD, OSF */            \
   || defined (__STDIO_H)              /* Borland */             \
   || defined (__STDIO_H__)            /* IRIX */                \
   || defined (_STDIO_INCLUDED)        /* HPUX */                \
   || defined (__dj_include_stdio_h_)  /* DJGPP */               \
   || defined (_FILE_DEFINED)          /* Microsoft */          \
   || defined (__STDIO__)              /* Apple MPW MrC */
#define _GMP_H_HAVE_FILE 1
#endif

  It appears for me to be a hack. On some systems, it may not work, and 
it may change in the future.

  Why don't use this:
#if defined (EOF)
#define _GMP_H_HAVE_FILE 1
#endif

  EOF should be defined only in stdio.h, and it is a standard constante, no?

  Why do you think of this ?

Sincerely,
  Patrick Pelissier




More information about the gmp-devel mailing list