autoconf
[Top][All Lists]
Advanced

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

Re: uint64_t fails with C++


From: Peter O'Gorman
Subject: Re: uint64_t fails with C++
Date: Wed, 07 Dec 2011 12:15:26 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14

On 12/07/2011 12:08 PM, Werner LEMBERG wrote:

    #if defined UINT64_MAX || defined uint64_t
    typedef uint64_t TA_ULongLong;
    #else
    #  error "No unsigned 64bit wide data type found."
    #endif

stdint.h will not define UINT64_MAX if __cplusplus is defined unless
__STDC_LIMIT_MACROS is defined before you include it.

Thanks.  However, this still doesn't explain why autoconf (using g++!)
says that uint64_t exists: __STDC_LIMIT_MACROS is not used in any part
of autoconf.

Am I missing something?


     Werner


PS: If using __STDC_LIMIT_MACROS is the `official' way to handle
     uint64 I suggest to update the autoconf documentation accordingly.


It's nothing to do with autoconf really, configure correctly finds uint64_t, your C program then checks for UINT64_MAX or a uint64_t macro instead of #include <config.h> and checking for HAVE_UINT64_T.

C++ compilers do not get these definition from stdint.h unless __STDC_LIMIT_MACROS is defined, the macros are in C99 and later, but were not in the C++ standard of the day (I don't know if they're in later C++ standards), so aren't defined for C++ compilers by default.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]