Ensure we don't #define constants before system headers
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 20 Jan 2014 21:07:36 +0000 (22:07 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 21 Jan 2014 16:57:57 +0000 (17:57 +0100)
For whatever reason, some older libc (e.g. as found on BG/Q login
nodes) live life such that they unilaterally #define some of the same
M_* constants that we do. If we ever #include <math.h> after
"gromacs/math/utilities.h" then those constants can differ and cause
compilation errors, because we've double-crossed our own #ifndef
attempts.

Change-Id: I4bd6d80e87489cc6f616ce0fb4260a0ac4f9e111

src/gromacs/math/utilities.h

index aac50d10b66c00fc95265ceb30a0f1d749df06c6..c6db48d9a3759fc0926da3b9b443524004bec769 100644 (file)
 #ifndef GMX_MATH_UTILITIES_H
 #define GMX_MATH_UTILITIES_H
 
-#include "../legacyheaders/types/simple.h"
 #include <limits.h>
+#include <math.h>
+
+#include "../legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {