stdinttest.cpp
#include <stdint.h>
#include <iostream>
using namespace std;
int main( int argc, char* argv[] ){
cout << "test stdint.h" << endl;
#ifdef UINT16_MAX
cout << "UINT16_MAX " << UINT16_MAX << endl;
#else
cout << "UINT16_MAX not defined " << endl;
#endif
}
Centos 7
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
проверяем
$ g++ -o test.centos stdinttest.cpp && test.centos
test stdint.h
UINT16_MAX not defined
Gentoo
$ g++ -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/portage/sys-devel/gcc-4.8.5/work/gcc-4.8.5/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.5 p1.3, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.8.5 (Gentoo 4.8.5 p1.3, pie-0.6.2)
Проверяем
$ g++ -o test.gentoo stdinttest.cpp && test.gentoo
test stdint.h
UINT16_MAX 65535
Переносимость, my ass.
Вот кто тут чудак, а кто молодец?
И как с этим бороться?
UPD решилось тупым прописыванием #ifndef & #define костыли на костылях костылями погоняют