Declare __STDC_*_MACROS in gmxpre.h
[alexxy/gromacs.git] / src / gromacs / utility / basedefinitions.h
index faa4395328c4c3eaefabbf99dc4b2a2bf2e60ac2..10ed2c7f6df3d40908406808746e8abd85d84d05 100644 (file)
 
 /* Information about integer data type sizes */
 #include <limits.h>
-#define __STDC_LIMIT_MACROS
 #include <stdint.h>
 #ifndef _MSC_VER
-#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 #endif
 
@@ -207,4 +205,25 @@ typedef uint64_t gmx_uint64_t;
 #endif
 #endif
 
+#ifndef __has_feature
+/** For compatibility with non-clang compilers. */
+#define __has_feature(x) 0
+#endif
+
+/*! \def gmx_noreturn
+ * \brief
+ * Indicate that a function is not expected to return.
+ *
+ */
+#ifndef gmx_noreturn
+#if defined(__GNUC__) || __has_feature(attribute_analyzer_noreturn)
+#define gmx_noreturn __attribute__((noreturn))
+#elif defined (_MSC_VER)
+#define gmx_noreturn __declspec(noreturn)
+#else
+#define gmx_noreturn
+#endif
+#endif
+
+
 #endif