Home | History | Annotate | Line # | Download | only in src
      1 /* mpfr_clears --  free the memory space allocated for several
      2    floating-point numbers
      3 
      4 Copyright 2003-2004, 2006-2023 Free Software Foundation, Inc.
      5 Contributed by the AriC and Caramba projects, INRIA.
      6 
      7 This file is part of the GNU MPFR Library.
      8 
      9 The GNU MPFR Library is free software; you can redistribute it and/or modify
     10 it under the terms of the GNU Lesser General Public License as published by
     11 the Free Software Foundation; either version 3 of the License, or (at your
     12 option) any later version.
     13 
     14 The GNU MPFR Library is distributed in the hope that it will be useful, but
     15 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     16 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
     17 License for more details.
     18 
     19 You should have received a copy of the GNU Lesser General Public License
     20 along with the GNU MPFR Library; see the file COPYING.LESSER.  If not, see
     21 https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
     22 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
     23 
     24 #ifdef HAVE_CONFIG_H
     25 # include "config.h"
     26 #endif
     27 
     28 #if HAVE_STDARG
     29 # include <stdarg.h>
     30 #else
     31 # include <varargs.h>
     32 #endif
     33 
     34 #include "mpfr-impl.h"
     35 
     36 void
     37 #if HAVE_STDARG
     38 mpfr_clears (mpfr_ptr x, ...)
     39 #else
     40 mpfr_clears (va_alist)
     41  va_dcl
     42 #endif
     43 {
     44   va_list arg;
     45 
     46 #if HAVE_STDARG
     47   va_start (arg, x);
     48 #else
     49   mpfr_ptr x;
     50   va_start(arg);
     51   x =  va_arg (arg, mpfr_ptr);
     52 #endif
     53 
     54   while (x != 0)
     55     {
     56       mpfr_clear (x);
     57       x = (mpfr_ptr) va_arg (arg, mpfr_ptr);
     58     }
     59   va_end (arg);
     60 }
     61