summaryrefslogtreecommitdiff
path: root/mpfr-impl.h
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-07-09 11:39:29 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-07-09 11:39:29 +0000
commit5322be306d3069de6c32c7566f6125c9d2f1830f (patch)
tree5ae381047117cf59cb76dc445a092de1ab32debe /mpfr-impl.h
parent59b9798a0bffc3dea57556162cb8102133166dcc (diff)
downloadmpfr-5322be306d3069de6c32c7566f6125c9d2f1830f.tar.gz
<stdio.h> and <limits.h> are now included unconditionally in mpfr-impl.h
(removed their inclusion from the C files for consistency). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4632 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mpfr-impl.h')
-rw-r--r--mpfr-impl.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/mpfr-impl.h b/mpfr-impl.h
index 9cb53f5a4..4164de1cc 100644
--- a/mpfr-impl.h
+++ b/mpfr-impl.h
@@ -23,10 +23,16 @@ MA 02110-1301, USA. */
#ifndef __MPFR_IMPL_H__
#define __MPFR_IMPL_H__
-/* Include stdio.h iff we are debugging or we want to check */
-#if defined(DEBUG) || defined(WANT_ASSERT)
-# include <stdio.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
+ options may hide the error).
+ Note: If some source file must not have such a header included
+ (which is very unlikely and probably means something broken in
+ this source file), we should do that with some macro (that would
+ also force to disable incompatible features). */
+#include <stdio.h>
+#include <limits.h>
/* Check if we are inside a build of MPFR or inside the test suite.
This is needed in mpfr.h to export or import the functions.
@@ -292,7 +298,7 @@ __MPFR_DECLSPEC extern const mpfr_t __gmpfr_four;
it needs to be used again in the future. */
#ifdef MPFR_USE_WARNINGS
-/* Note: needs <stdio.h> and <stdlib.h> */
+# include <stdlib.h>
# define MPFR_WARNING(W) \
do \
{ \
@@ -901,7 +907,6 @@ do { \
/* MPFR_TRACE (operation) : execute operation iff DEBUG flag is set */
/* MPFR_DUMP (x) : print x (a mpfr_t) on stdout */
#ifdef DEBUG
-# include <stdio.h>
# define MPFR_TRACE(x) x
#else
# define MPFR_TRACE(x) (void) 0
@@ -1271,8 +1276,6 @@ typedef struct {
#ifdef MPFR_USE_LOGGING
-# include <stdio.h>
-
/* Check if we can support this feature */
# ifdef MPFR_USE_THREAD_SAFE
# error "Enable either `Logging' or `thread-safe', not both"