Current-Users archive

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

Re: LLONG_MAX not available from c++



On Fri, Mar 31, 2023 at 02:10:46PM +0200, Thomas Klausner wrote:
> g++ in -current doesn't get this symbol when you include limits.h
> (which lua does, since this is still C code) because of (from
> /usr/include/machine/limits.h):
> 
> #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
>     defined(_NETBSD_SOURCE)
> #define ULLONG_MAX      0xffffffffffffffffULL   /* max unsigned long long */
> #define LLONG_MAX       0x7fffffffffffffffLL    /* max signed long long */

Which options does it pass to g++ ?

For me just invoking "g++" defines __STDC_VERSION__ as 201710L, so should
get the symbol:

> g++ -dM -E - < /dev/null | fgrep STDC
#define __STDC_UTF_16__ 1
#define __STDC_VERSION__ 201710L
#define __GNUC_STDC_INLINE__ 1
#define __STDC_UTF_32__ 1
#define __STDC__ 1
#define __STDC_HOSTED__ 1


Martin


Home | Main Index | Thread Index | Old Index