summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-09-10 00:17:06 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-09-10 00:17:06 +0000
commitdf10a35cd2f438fc8f55ef15a2bfecfa109ee006 (patch)
tree35fcc6d90893ff4cdaab5db333397fed2c9b1a28
parenta61bbe8601aac72fd18d038cbe768bf664ce7bc2 (diff)
downloadmpfr-df10a35cd2f438fc8f55ef15a2bfecfa109ee006.tar.gz
Include config.h when need be.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9675 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/mpfr-impl.h11
-rw-r--r--tests/mpfr-test.h5
-rw-r--r--tests/tfprintf.c5
-rw-r--r--tests/tprintf.c5
-rw-r--r--tests/tsprintf.c5
5 files changed, 25 insertions, 6 deletions
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h
index 97cd869b3..096e6e2c1 100644
--- a/src/mpfr-impl.h
+++ b/src/mpfr-impl.h
@@ -23,6 +23,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifndef __MPFR_IMPL_H__
#define __MPFR_IMPL_H__
+/* Include config.h before using ANY configure macros if needed. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
/* Let's include some standard headers unconditionally as they are
already needed by several source files or when some options are
enabled/disabled, and it is easy to forget them (some configure
@@ -64,12 +69,6 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
****************** Include files *********************
******************************************************/
-/* Include 'config.h' before using ANY configure macros if needed
- NOTE: It isn't MPFR 'config.h', but GMP's one! */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
/* For the definition of MPFR_THREAD_ATTR. GCC/ICC detection macros are
no longer used, as they sometimes gave incorrect information about
the support of thread-local variables. A configure check is now done. */
diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h
index 6e39b7a28..5e67905af 100644
--- a/tests/mpfr-test.h
+++ b/tests/mpfr-test.h
@@ -23,6 +23,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifndef __MPFR_TEST_H__
#define __MPFR_TEST_H__
+/* Include config.h before using ANY configure macros if needed. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
/* The no assertion request doesn't apply to the tests */
#if defined(MPFR_WANT_ASSERT)
# if MPFR_WANT_ASSERT < 0
diff --git a/tests/tfprintf.c b/tests/tfprintf.c
index 41d067f15..97de9b9cc 100644
--- a/tests/tfprintf.c
+++ b/tests/tfprintf.c
@@ -20,6 +20,11 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* Include config.h before using ANY configure macros if needed. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#if defined(HAVE_STDARG) && !defined(MPFR_USE_MINI_GMP)
#include <stdarg.h>
diff --git a/tests/tprintf.c b/tests/tprintf.c
index 7c685264b..07f641ade 100644
--- a/tests/tprintf.c
+++ b/tests/tprintf.c
@@ -20,6 +20,11 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* Include config.h before using ANY configure macros if needed. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#if defined(HAVE_STDARG) && !defined(MPFR_USE_MINI_GMP)
#include <stdarg.h>
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index bb399323f..d2c0c541a 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -21,6 +21,11 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* Include config.h before using ANY configure macros if needed. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#if defined(HAVE_STDARG) && !defined(MPFR_USE_MINI_GMP)
#include <stdarg.h>