From 46ce85119999f121649d0b7add3e409940d9763d Mon Sep 17 00:00:00 2001 From: wbhart Date: Sat, 10 Jan 2009 16:27:38 +0000 Subject: [PATCH] Removed attributes and facets only for Sun CC instead of all non-GNU compilers. --- cxx/ismpf.cc | 4 ++-- cxx/ismpz.cc | 2 +- cxx/osmpf.cc | 2 +- gmp-impl.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cxx/ismpf.cc b/cxx/ismpf.cc index e5f8bb8b..99cf5afa 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 && defined (__GNUC__) +#if HAVE_STD__LOCALE && !defined (__sun) 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 && defined(__GNUC__) +#if HAVE_STD__LOCALE && !defined(__sun) 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 1c1414fc..a4ba3fa2 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 && defined (__GNUC__) +#if HAVE_STD__LOCALE && !defined (__sun) 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 e4660181..f63fd672 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 && defined (__GNUC__) +#if HAVE_STD__LOCALE && !defined (__sun) 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 26fd59a2..aa1cd611 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) && defined (__GNUC__) +#if HAVE_ATTRIBUTE_CONST && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE) && !( defined (__cplusplus) && defined (__sun)) #define ATTRIBUTE_CONST __attribute__ ((const)) #else #define ATTRIBUTE_CONST #endif -#if HAVE_ATTRIBUTE_NORETURN && defined (__GNUC__) +#if HAVE_ATTRIBUTE_NORETURN && !( defined (__cplusplus) && defined (__sun)) #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 && defined (__GNUC__) +#if HAVE_ATTRIBUTE_MALLOC && !( defined (__cplusplus) && defined (__sun)) #define ATTRIBUTE_MALLOC __attribute__ ((malloc)) #else #define ATTRIBUTE_MALLOC