I'm intending to write a C++ library that I want to be cross-platform. I'm just wondering if I would have to allow for platforms that lack any 64-bit integer types.
I know that there are 8- or 16-bit embedded systems with C compilers that have 32-bit integers but lack 64-bit integers (e.g. MSP430, at least historically), but is that true for any C++ compilers for such systems?
Context: I'm actually wanting to port a simple pseudo-random number generator C library of mine to C++. The C library mainly deals with 32-bit integers, but has some optional 64-bit API. Also the 32-bit code can do some internal calculations using 64-bit implementations (which are very simple), or alternatively using a 32-bit-only implementations (which are more complicated). The C headers have #ifdef UINT64_C
to enable/disable the 64-bit APIs. The C files have #ifdef UINT64_C
to select between 64-bit or 32-bit-only implementations of some functions. So, do I have to do the same for a C++ library, or is it a safe assumption that uint64_t
is always available?