Fixed numerous issues which prevented compilation with --enable-cxx on Sun CC.

This commit is contained in:
wbhart 2009-01-10 04:51:24 +00:00
parent 4f2cb35bc0
commit 811e7de5a7
5 changed files with 9 additions and 9 deletions

View File

@ -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<char> >(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<char>& ct = use_facet< ctype<char> >(loc);
#define cxx_isspace(c) (ct.is(ctype_base::space,(c)))
#else

View File

@ -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<char>& ct = use_facet< ctype<char> >(i.getloc());
#define cxx_isspace(c) (ct.is(ctype_base::space,(c)))
#else

View File

@ -44,7 +44,7 @@ operator<< (ostream &o, mpf_srcptr f)
__gmp_doprnt_params_from_ios (&param, o);
#if HAVE_STD__LOCALE
#if HAVE_STD__LOCALE && defined (__GNUC__)
char point[2];
point[0] = use_facet< numpunct<char> >(o.getloc()).decimal_point();
point[1] = '\0';

View File

@ -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)));

View File

@ -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);
}
};