diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-04 22:47:09 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-04 22:47:09 +0000 |
commit | 9112dfd67ffd33a0f896ecf9afc6e85ac1950966 (patch) | |
tree | 3acb33eb8de62565cb881f6fab4e809e7f2c02d3 | |
parent | 53069c1fecdb1d8c15affdd701afeb9a30a52b23 (diff) | |
download | mpfr-9112dfd67ffd33a0f896ecf9afc6e85ac1950966.tar.gz |
Simplified the use of MPFR_USE_FILE since <stdio.h> (<cstdio> for C++)
is unconditionally included.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11893 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/dump.c | 1 | ||||
-rw-r--r-- | src/fpif.c | 1 | ||||
-rw-r--r-- | src/inp_str.c | 2 | ||||
-rw-r--r-- | src/mpfr-impl.h | 5 | ||||
-rw-r--r-- | src/out_str.c | 1 | ||||
-rw-r--r-- | tests/mpfr-test.h | 4 | ||||
-rw-r--r-- | tests/tvalist.c | 3 |
7 files changed, 8 insertions, 9 deletions
diff --git a/src/dump.c b/src/dump.c index 130235529..530ea65b1 100644 --- a/src/dump.c +++ b/src/dump.c @@ -20,7 +20,6 @@ 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. */ -#define MPFR_USE_FILE #include "mpfr-impl.h" /* mpfr_dump is mainly for debugging purpose. It outputs a MPFR number diff --git a/src/fpif.c b/src/fpif.c index 43421fffb..0d5d9f4d0 100644 --- a/src/fpif.c +++ b/src/fpif.c @@ -21,7 +21,6 @@ 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. */ -#define MPFR_USE_FILE #include "mpfr-impl.h" #if !defined (HAVE_BIG_ENDIAN) && !defined (HAVE_LITTLE_ENDIAN) diff --git a/src/inp_str.c b/src/inp_str.c index d7dd550d4..7facdeaae 100644 --- a/src/inp_str.c +++ b/src/inp_str.c @@ -22,7 +22,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <ctype.h> -#define MPFR_USE_FILE + #include "mpfr-impl.h" /* The original version of this function came from GMP's mpf/inp_str.c; diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h index 78df49cfb..0c55b8f72 100644 --- a/src/mpfr-impl.h +++ b/src/mpfr-impl.h @@ -50,6 +50,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # include <string.h> #endif +/* Since <stdio.h> (<cstdio> for C++) is unconditionally included... */ +#ifndef MPFR_DONT_USE_FILE +# define MPFR_USE_FILE +#endif + #include <stdlib.h> #include <limits.h> diff --git a/src/out_str.c b/src/out_str.c index 4b51b12e5..636c63454 100644 --- a/src/out_str.c +++ b/src/out_str.c @@ -20,7 +20,6 @@ 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. */ -#define MPFR_USE_FILE #include "mpfr-impl.h" /* Warning! S should not contain "%". */ diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h index 42f242004..7bcc15f37 100644 --- a/tests/mpfr-test.h +++ b/tests/mpfr-test.h @@ -20,10 +20,6 @@ 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. */ -#ifdef MPFR_USE_MINI_GMP -#define MPFR_USE_FILE -#endif - #ifndef __MPFR_TEST_H__ #define __MPFR_TEST_H__ diff --git a/tests/tvalist.c b/tests/tvalist.c index 42cb196a8..71af963f4 100644 --- a/tests/tvalist.c +++ b/tests/tvalist.c @@ -28,6 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # include <stdint.h> #endif +#define MPFR_DONT_USE_FILE /* don't use FILE in mpfr-impl.h */ #ifdef MPFR_USE_MINI_GMP #include "mpfr-test.h" #endif @@ -47,7 +48,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * was fixed in r7320. * * With mini-gmp, mpfr-impl.h is included first, but this should not - * affect this test. + * affect this test thanks to MPFR_DONT_USE_FILE. */ #include <mpfr.h> |