diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-03-20 13:30:41 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-03-20 13:30:41 +0000 |
commit | 5582906aab7f861d6747c5db14a4d5796511364f (patch) | |
tree | 226ed9af4317e7cf65db4c3338a2731ea8d9ad1c /src/jtutil | |
parent | 81c2f1616b5353669a81c3f688a0ba6abf167c32 (diff) |
guard inline functions which use <math.h> fns inside #ifdef M_PI
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@997 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/jtutil')
-rw-r--r-- | src/jtutil/util.hh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/jtutil/util.hh b/src/jtutil/util.hh index 020584b..ddba0d7 100644 --- a/src/jtutil/util.hh +++ b/src/jtutil/util.hh @@ -86,9 +86,12 @@ template <typename fp_t> // // more misc math stuff, valid only if <math.h> has been #included; // -// floor/ceiling of double, returned as an int -inline int ifloor(double x) { return static_cast<int>(floor(x)); } -inline int iceil (double x) { return static_cast<int>(ceil (x)); } +#ifdef M_PI /* test for <math.h> */ + /* n.b. C-style comment needed for some preprocessors! */ + // floor/ceiling of double, returned as an int + inline int ifloor(double x) { return static_cast<int>(floor(x)); } + inline int iceil (double x) { return static_cast<int>(ceil (x)); } +#endif #ifdef PI /* PI is defined in "../include/stdc.h" */ /* n.b. C-style comment needed for some preprocessors! */ |