summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-12-22 10:57:56 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-12-22 10:57:56 +0000
commitfd8400aa1fac40bb84b5a8b64c887776d87fd6e3 (patch)
tree407cf2a1984f56507846294e86064bbe267889e3
parentec596858e24e5457f109b77ee50fd0daefa7316c (diff)
downloadmpfr-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.c27
-rw-r--r--inits.c29
-rw-r--r--inits2.c30
3 files changed, 73 insertions, 13 deletions
diff --git a/clears.c b/clears.c
index 54b7008cc..bf4afa33e 100644
--- a/clears.c
+++ b/clears.c
@@ -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);
diff --git a/inits.c b/inits.c
index 19e6dd643..362a4cf07 100644
--- a/inits.c
+++ b/inits.c
@@ -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);
diff --git a/inits2.c b/inits2.c
index a66ac4e39..4a26881cf 100644
--- a/inits2.c
+++ b/inits2.c
@@ -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);