[exim-dev] LLONG_MAX etc.

Etusivu
Poista viesti
Vastaa
Lähettäjä: Phil Pennock
Päiväys:  
Vastaanottaja: Jeremy Harris
Kopio: exim-dev
Aihe: [exim-dev] LLONG_MAX etc.
So LLONG_MAX and friends are C99 additions and it's reasonable for a
system to conceal them until told it is in C99 mode.

Note that in exim.h we already handle some __ namespace bending for
limits.h, centrally rather than in an OS/ file:

----------------------------8< cut here >8------------------------------
#if defined(__svr4__) && defined(__sparc) && ! defined(__EXTENSIONS__)
#define __EXTENSIONS__ /* so that SunOS 5 gets NGROUPS_MAX */
#include <limits.h>
#undef __EXTENSIONS__
#else
#include <limits.h>
#endif
----------------------------8< cut here >8------------------------------

I think that the comment I added at the start of OS/os.h-Linux needs to
change to "some weird Linux systems in use do not include <features.h>
in <limits.h>, although they should." Leave <features.h> there.

The Linux <features.h> states:
----------------------------8< cut here >8------------------------------
/* These are defined by the user (or the compiler)
   to specify the desired environment:
...
   _ISOC99_SOURCE       Extensions to ISO C89 from ISO C99.
... */


/* This is to enable the ISO C99 extension.  Also recognize the old macro
   which was used prior to the standard acceptance.  This macro will
   eventually go away and the features enabled by default once the ISO C99
   standard is widely adopted.  */
#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99   1
#endif
----------------------------8< cut here >8------------------------------


Since we're now actually using C99 features, the 64-bit arithmetic, and
_ISOC99_SOURCE is an unambiguous name, we should probably grab it in,
unambiguously, for all systems, in exim.h. If it's not used, it's
harmless.

After 4.80, we might consider switching to _GNU_SOURCE, but that
potentially changes enough extra stuff that I don't want to do it at
this stage in the release process.

So, I'll commit that, fire off the test suite, see if it all goes well
and then cut RC5 if so.

-Phil
of the issue: if i