Try the following program with g++ with and without the first line: #define __STDC_LIMIT_MACROS 1 #include <limits.h> #include <stdint.h> #include <iostream>
using namespace std; #if INTMAX_MAX != LONG_MAX #error error2 #endif #if INTMAX_MAX != LLONG_MAX #error error3 #endif #if UINTMAX_MAX != ULONG_MAX #error error5 #endif #if UINTMAX_MAX != ULLONG_MAX #error error6 #endif int main(void) { intmax_t a = 0; cout << INTMAX_MAX << " " << LLONG_MAX << endl; return 0; } On 9 April 2014 16:38, Jean-Pierre Flori <jpfl...@gmail.com> wrote: > Oh sure, one has to use g++... and the the !__cpluplus becomes false. > > 2014-04-09 16:36 GMT+02:00 Bill Hart <goodwillh...@googlemail.com>: > > g++ bla.c > > prag.c:5:17: warning: expected a string after '#pragma message' > [-Wpragmas] > > #pragma message INTMAX_MAX > > ^ > > prag.c:6:17: warning: expected a string after '#pragma message' > [-Wpragmas] > > #pragma message __STDC_LIMIT_MACROS > > > > > > > > On 9 April 2014 16:33, Jean-Pierre Flori <jpfl...@gmail.com> wrote: > >> > >> 2014-04-09 16:24 GMT+02:00 Bill Hart <goodwillh...@googlemail.com>: > >> > Yeah, as I said, they get defined only if you first do: > >> > > >> > #define __STDC_LIMIT_MACROS 1 > >> It seems I don't need this define on my setup (unless I misunderstood > >> you): > >> > >> $ cat bla.c > >> #include <stdint.h> > >> #include <limits.h> > >> > >> #pragma message LONG_MAX > >> #pragma message INTMAX_MAX > >> #pragma message __STDC_LIMIT_MACROS > >> #if LONG_MAX == INTMAX_MAX > >> #pragma message eq > >> #endif > >> > >> $cpp bla.c > >> ... > >> # 4 "bla.c" > >> #pragma message 9223372036854775807L > >> # 4 "bla.c" > >> > >> > >> # 5 "bla.c" > >> #pragma message (9223372036854775807L) > >> # 5 "bla.c" > >> > >> > >> # 6 "bla.c" > >> #pragma message __STDC_LIMIT_MACROS > >> # 6 "bla.c" > >> > >> > >> > >> # 8 "bla.c" > >> #pragma message eq > >> # 8 "bla.c" > > > > > > > > -- > Jean-Pierre Flori > -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+unsubscr...@googlegroups.com. To post to this group, send email to mpir-devel@googlegroups.com. Visit this group at http://groups.google.com/group/mpir-devel. For more options, visit https://groups.google.com/d/optout.