diff --git a/cxx/ismpf.cc b/cxx/ismpf.cc index 26eeb5cc..e5f8bb8b 100644 --- a/cxx/ismpf.cc +++ b/cxx/ismpf.cc @@ -50,7 +50,7 @@ operator>> (istream &i, mpf_ptr f) const char *lconv_point = localeconv()->decimal_point; // C++ decimal point -#if HAVE_STD__LOCALE +#if HAVE_STD__LOCALE && defined (__GNUC__) const locale& loc = i.getloc(); char point_char = use_facet< numpunct >(loc).decimal_point(); #else @@ -63,7 +63,7 @@ operator>> (istream &i, mpf_ptr f) if (i.flags() & ios::skipws) // skip initial whitespace { // C++ isspace -#if HAVE_STD__LOCALE +#if HAVE_STD__LOCALE && defined(__GNUC__) const ctype& ct = use_facet< ctype >(loc); #define cxx_isspace(c) (ct.is(ctype_base::space,(c))) #else diff --git a/cxx/ismpz.cc b/cxx/ismpz.cc index 0c4f0005..1c1414fc 100644 --- a/cxx/ismpz.cc +++ b/cxx/ismpz.cc @@ -39,7 +39,7 @@ operator>> (istream &i, mpz_ptr z) if (i.flags() & ios::skipws) // skip initial whitespace { -#if HAVE_STD__LOCALE +#if HAVE_STD__LOCALE && defined (__GNUC__) const ctype& ct = use_facet< ctype >(i.getloc()); #define cxx_isspace(c) (ct.is(ctype_base::space,(c))) #else diff --git a/cxx/osmpf.cc b/cxx/osmpf.cc index 74d1b2c4..e4660181 100644 --- a/cxx/osmpf.cc +++ b/cxx/osmpf.cc @@ -44,7 +44,7 @@ operator<< (ostream &o, mpf_srcptr f) __gmp_doprnt_params_from_ios (¶m, o); -#if HAVE_STD__LOCALE +#if HAVE_STD__LOCALE && defined (__GNUC__) char point[2]; point[0] = use_facet< numpunct >(o.getloc()).decimal_point(); point[1] = '\0'; diff --git a/gmp-impl.h b/gmp-impl.h index d36e8a70..26fd59a2 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -218,13 +218,13 @@ typedef unsigned long gmp_uint_least32_t; is more restrictive than "pure". See info node "(gcc)Function Attributes". __GMP_NO_ATTRIBUTE_CONST_PURE lets tune/common.c etc turn this off when trying to write timing loops. */ -#if HAVE_ATTRIBUTE_CONST && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE) +#if HAVE_ATTRIBUTE_CONST && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE) && defined (__GNUC__) #define ATTRIBUTE_CONST __attribute__ ((const)) #else #define ATTRIBUTE_CONST #endif -#if HAVE_ATTRIBUTE_NORETURN +#if HAVE_ATTRIBUTE_NORETURN && defined (__GNUC__) #define ATTRIBUTE_NORETURN __attribute__ ((noreturn)) #else #define ATTRIBUTE_NORETURN @@ -232,7 +232,7 @@ typedef unsigned long gmp_uint_least32_t; /* "malloc" means a function behaves like malloc in that the pointer it returns doesn't alias anything. */ -#if HAVE_ATTRIBUTE_MALLOC +#if HAVE_ATTRIBUTE_MALLOC && defined (__GNUC__) #define ATTRIBUTE_MALLOC __attribute__ ((malloc)) #else #define ATTRIBUTE_MALLOC @@ -2807,7 +2807,7 @@ __GMP_DECLSPEC extern const unsigned char modlimb_invert_table[128]; /* Define stuff for longlong.h. */ -#if HAVE_ATTRIBUTE_MODE +#if HAVE_ATTRIBUTE_MODE && defined (__GNUC__) typedef unsigned int UQItype __attribute__ ((mode (QI))); typedef int SItype __attribute__ ((mode (SI))); typedef unsigned int USItype __attribute__ ((mode (SI))); diff --git a/gmpxx.h b/gmpxx.h index 292aacf4..5e9606ba 100644 --- a/gmpxx.h +++ b/gmpxx.h @@ -1301,7 +1301,7 @@ struct __gmp_alloc_cstring { void (*freefunc) (void *, size_t); mp_get_memory_functions (NULL, NULL, &freefunc); - (*freefunc) (str, std::strlen(str)+1); + (*free_func) (str, std::strlen(str)+1); } };