diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-12-22 10:57:56 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-12-22 10:57:56 +0000 |
commit | fd8400aa1fac40bb84b5a8b64c887776d87fd6e3 (patch) | |
tree | 407cf2a1984f56507846294e86064bbe267889e3 | |
parent | ec596858e24e5457f109b77ee50fd0daefa7316c (diff) | |
download | mpfr-fd8400aa1fac40bb84b5a8b64c887776d87fd6e3.tar.gz |
Explicit support for K&R C since ansi2knr can't be used.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2588 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | clears.c | 27 | ||||
-rw-r--r-- | inits.c | 29 | ||||
-rw-r--r-- | inits2.c | 30 |
3 files changed, 73 insertions, 13 deletions
@@ -20,18 +20,37 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdarg.h> -#include "gmp.h" -#include "gmp-impl.h" -#include "mpfr.h" +/* Needed for build with GMP */ +#ifndef HAVE_STDARG +# include "config.h" +#endif + +#if HAVE_STDARG +# include <stdarg.h> +#else +# include <varargs.h> +#endif + #include "mpfr-impl.h" void +#if HAVE_STDARG mpfr_clears (mpfr_ptr x, ...) +#else +mpfr_clears (va_alist) + va_dcl +#endif { va_list arg; +#if HAVE_STDARG va_start (arg, x); +#else + mpfr_ptr x; + va_start(arg); + x = va_arg (arg, mpfr_ptr); +#endif + while (x != 0) { mpfr_clear (x); @@ -19,18 +19,39 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdarg.h> -#include "gmp.h" -#include "gmp-impl.h" -#include "mpfr.h" +/* Needed for build with GMP */ +#ifndef HAVE_STDARG +# include "config.h" +#endif + +#if HAVE_STDARG +# include <stdarg.h> +#else +# include <varargs.h> +#endif + #include "mpfr-impl.h" +/* Since it uses "...", we need an explicit support for K&R */ + void +#if HAVE_STDARG mpfr_inits (mpfr_ptr x, ...) +#else +mpfr_inits (va_alist) + va_dcl +#endif { va_list arg; +#if HAVE_STDARG va_start (arg, x); +#else + mpfr_ptr x; + va_start(arg); + x = va_arg (arg, mpfr_ptr); +#endif + while (x != 0) { mpfr_init (x); @@ -20,22 +20,42 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdarg.h> -#include "gmp.h" -#include "gmp-impl.h" -#include "mpfr.h" +/* Needed for build with GMP */ +#ifndef HAVE_STDARG +# include "config.h" +#endif + +#if HAVE_STDARG +# include <stdarg.h> +#else +# include <varargs.h> +#endif + #include "mpfr-impl.h" /* * Contrary to mpfr_init2, mp_prec_t p is the first argument */ +/* Explicit support for K&R compiler */ void +#if HAVE_STDARG mpfr_inits2 (mp_prec_t p, mpfr_ptr x, ...) +#else +mpfr_inits2 (va_alist) + va_dcl +#endif { va_list arg; - +#if HAVE_STDARG va_start (arg, x); +#else + mp_prec_t p; + mpfr_ptr x; + va_start(arg); + p = va_arg (arg, mp_prec_t); + x = va_arg (arg, mpfr_ptr); +#endif while (x != 0) { mpfr_init2 (x, p); |