Declare __STDC_*_MACROS in gmxpre.h
[alexxy/gromacs.git] / src / gmxpre.h
index 3ae077ecb3fe7247b03ad71fb154a0d4d8115aca..0573e37a11a77bbaf7147b63d6c47920f42016ab 100644 (file)
 #define _GNU_SOURCE 1
 #endif
 
+/* Some C++(?) compilers require these to be defined to get the integer limits
+ * and format specifier macros from stdint.h and inttypes.h, respectively.
+ * The macros are in C99 and C++11, but not in C++98...
+ * As with _GNU_SOURCE, these need to be defined before these headers get first
+ * included.  Unlike _GNU_SOURCE, these headers are included indirectly in most
+ * header and source files (even though the macros are not used that often), so
+ * there is no easy alternative to defining them here, either.
+ * If someone happens to use such a compiler to compile against the installed
+ * Gromacs headers, they need for now take care to define the macros themselves
+ * (as there is no way Gromacs can do that consistently).
+ */
+#define __STDC_LIMIT_MACROS
+#define __STDC_FORMAT_MACROS
+
 #ifdef GMX_FAHCORE
 #define FULLINDIRECT 1
 #define USE_FAH_XDR  1