diff options
author | Alexander Pyhalov <apyhalov@gmail.com> | 2013-06-14 10:16:47 +0400 |
---|---|---|
committer | Dan McDonald <danmcd@nexenta.com> | 2013-06-18 15:14:49 -0400 |
commit | 693e4d84eb49b987c3d66cbcd4b13a5c6e9059bf (patch) | |
tree | 50096ba7817a6bc83a0220cec65e02e9b3294920 | |
parent | b77dfcc8362f3695ece944d5bb504276753a40f9 (diff) | |
download | illumos-joyent-693e4d84eb49b987c3d66cbcd4b13a5c6e9059bf.tar.gz |
3787 gcc4.7 __cplusplus change incompatibility
3823 wchar.h and wctype_iso.h incompatibility
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
-rw-r--r-- | usr/src/head/iso/stdio_iso.h | 6 | ||||
-rw-r--r-- | usr/src/head/iso/stdlib_iso.h | 10 | ||||
-rw-r--r-- | usr/src/head/wchar.h | 25 |
3 files changed, 31 insertions, 10 deletions
diff --git a/usr/src/head/iso/stdio_iso.h b/usr/src/head/iso/stdio_iso.h index e2272c51df..f974ad5b08 100644 --- a/usr/src/head/iso/stdio_iso.h +++ b/usr/src/head/iso/stdio_iso.h @@ -46,8 +46,6 @@ #ifndef _ISO_STDIO_ISO_H #define _ISO_STDIO_ISO_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/feature_tests.h> #include <sys/va_list.h> #include <stdio_tag.h> @@ -331,7 +329,7 @@ extern int _flsbuf(); #if !defined(__lint) -#if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) +#if !defined(_REENTRANT) && !defined(_LP64) #ifdef __STDC__ #if __cplusplus >= 199711L @@ -353,7 +351,7 @@ inline int putc(int _x, FILE *_p) { (int)(*(p)->_ptr++ = (unsigned char) (x))) #endif /* __STDC__ */ -#endif /* !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) */ +#endif /* !defined(_REENTRANT) && !defined(_LP64) */ #ifndef _REENTRANT diff --git a/usr/src/head/iso/stdlib_iso.h b/usr/src/head/iso/stdlib_iso.h index 2a636c59f3..17577a93dd 100644 --- a/usr/src/head/iso/stdlib_iso.h +++ b/usr/src/head/iso/stdlib_iso.h @@ -43,8 +43,6 @@ #ifndef _ISO_STDLIB_ISO_H #define _ISO_STDLIB_ISO_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/feature_tests.h> #ifdef __cplusplus @@ -128,12 +126,12 @@ extern int atoi(const char *); extern long int atol(const char *); extern void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); -#if __cplusplus >= 199711L +#if __cplusplus >= 199711L && defined(__SUNPRO_CC) extern "C++" { void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); } -#endif /* __cplusplus >= 199711L */ +#endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */ extern void *calloc(size_t, size_t); extern div_t div(int, int); extern void exit(int) @@ -148,11 +146,11 @@ extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t); extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t); extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); -#if __cplusplus >= 199711L +#if __cplusplus >= 199711L && defined(__SUNPRO_CC) extern "C++" { void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); } -#endif /* __cplusplus >= 199711L */ +#endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */ extern int rand(void); extern void *realloc(void *, size_t); extern void srand(unsigned int); diff --git a/usr/src/head/wchar.h b/usr/src/head/wchar.h index 781b57afb8..b80469846a 100644 --- a/usr/src/head/wchar.h +++ b/usr/src/head/wchar.h @@ -122,6 +122,9 @@ typedef __va_list va_list; #ifdef __STDC__ #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) +#if __cplusplus >= 199711L +namespace std { +#endif extern int iswalpha(wint_t); extern int iswupper(wint_t); extern int iswlower(wint_t); @@ -140,6 +143,28 @@ extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); extern int wcswidth(const wchar_t *, size_t); extern int wcwidth(wchar_t); extern wctype_t wctype(const char *); +#if __cplusplus >= 199711L +} /* namespace std */ + +using std::iswalpha; +using std::iswupper; +using std::iswlower; +using std::iswdigit; +using std::iswxdigit; +using std::iswalnum; +using std::iswspace; +using std::iswpunct; +using std::iswprint; +using std::iswgraph; +using std::iswcntrl; +using std::iswctype; +using std::towlower; +using std::towupper; +using std::wcswcs; +using std::wcswidth; +using std::wcwidth; +using std::wctype; +#endif #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */ #if defined(__EXTENSIONS__) || \ |