Commit d62bab6a by Rainer Orth Committed by Rainer Orth

re PR libstdc++/1773 (__cplusplus defined to 1, should be 199711L)

2011-08-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	    Marc Glisse  <marc.glisse@normalesup.org>

	PR libstdc++-v3/1773
	* inclhack.def (solaris_cxx_linkage, solaris_getc_strict_stdc)
	(solaris_longjmp_noreturn, solaris_pow_int_overload)
	(solaris_std___filbuf): New fixes.
	* tests/base/iso/math_iso.h, tests/base/iso/setjmp_iso.h,
	tests/base/iso/stdio_iso.h, tests/base/iso/stdlib_iso.h: New tests.
	* tests/base/stdio.h [SOLARIS_STD___FILBUF_CHECK]: New test.

Co-Authored-By: Marc Glisse <marc.glisse@normalesup.org>

From-SVN: r177613
parent 693ed633
2011-08-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Marc Glisse <marc.glisse@normalesup.org>
PR libstdc++-v3/1773
* inclhack.def (solaris_cxx_linkage, solaris_getc_strict_stdc)
(solaris_longjmp_noreturn, solaris_pow_int_overload)
(solaris_std___filbuf): New fixes.
* tests/base/iso/math_iso.h, tests/base/iso/setjmp_iso.h,
tests/base/iso/stdio_iso.h, tests/base/iso/stdlib_iso.h: New tests.
* tests/base/stdio.h [SOLARIS_STD___FILBUF_CHECK]: New test.
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR c++/49347
......
......@@ -3358,6 +3358,59 @@ fix = {
/*
* g++ rejects functions declared with both C and C++ linkage.
*/
fix = {
hackname = solaris_cxx_linkage;
mach = '*-*-solaris2*';
files = "iso/stdlib_iso.h";
select = "(#if __cplusplus >= 199711L)\n"
"(extern \"C\\+\\+\" \\{\n)"
"(.*(bsearch|qsort).*)";
c_fix = format;
c_fix_arg = "%1 && !__GNUG__\n%2%3";
test_text =
"#if __cplusplus >= 199711L\n"
"extern \"C++\" {\n"
" void *bsearch(const void *, const void *, size_t, size_t,";
};
/*
* Solaris <iso/stdio_iso.h> doesn't declare getc for C++ with
* _STRICT_STDC, but uses it.
*/
fix = {
hackname = solaris_getc_strict_stdc;
mach = "*-*-solaris2*";
files = "iso/stdio_iso.h";
select = "(.*&& )!defined\\(_STRICT_STDC\\)(.*)";
c_fix = format;
c_fix_arg = "%1(!defined(_STRICT_STDC) || (__cplusplus >= 199711L))%2";
test_text =
"#if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)";
};
/*
* Before Solaris 10, <iso/setjmp_iso.h> doesn't mark longjump noreturn.
*/
fix = {
hackname = solaris_longjmp_noreturn;
mach = "*-*-solaris2*";
files = "iso/setjmp_iso.h";
bypass = "__NORETURN";
select = "(.*longjmp\\(jmp_buf.*[^)]+\\));";
c_fix = format;
c_fix_arg = "%1 __attribute__ ((__noreturn__));";
test_text = "extern void longjmp(jmp_buf, int);";
};
/*
* Sun Solaris 10 defines several C99 math macros in terms of
* builtins specific to the Studio compiler, in particular not
* compatible with the GNU compiler.
......@@ -3530,6 +3583,24 @@ fix = {
/*
* The pow overloads with int were removed in C++ 2011.
*/
fix = {
hackname = solaris_pow_int_overload;
mach = '*-*-solaris2*';
files = "iso/math_iso.h";
select = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)"
" *\\{[^{}]*\n[^{}]*\\}";
c_fix = format;
c_fix_arg = "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n%0\n#endif";
test_text =
" inline long double pow(long double __X, int __Y) { return\n"
" __powl(__X, (long double) (__Y)); }";
};
/*
* Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some
* fields of the pthread_rwlock_t structure, which are of type
* upad64_t, which itself is typedef'd to int64_t, but with __STDC__
......@@ -3723,6 +3794,27 @@ fix = {
/*
* Before Solaris 10, <stdio.h> lacks declarations of std::__filbuf and
* std::__flsbuf, but <iso/stdio_iso.h> uses them.
*/
fix = {
hackname = solaris_std___filbuf;
files = stdio.h;
mach = '*-*-solaris2*';
bypass = "using std::__filbuf";
select = "(using std::perror;\n)(#endif)";
c_fix = format;
c_fix_arg = "%1#ifndef _LP64\n"
"using std::__filbuf;\n"
"using std::__flsbuf;\n"
"#endif\n%2";
test_text = "using std::perror;\n"
"#endif";
};
/*
* Sun Solaris 8 has what appears to be some gross workaround for
* some old version of their c++ compiler. G++ doesn't want it
* either, but doesn't want to be tied to SunPRO version numbers.
......
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/iso/math_iso.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_POW_INT_OVERLOAD_CHECK )
#ifndef __GXX_EXPERIMENTAL_CXX0X__
inline long double pow(long double __X, int __Y) { return
__powl(__X, (long double) (__Y)); }
#endif
#endif /* SOLARIS_POW_INT_OVERLOAD_CHECK */
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/iso/setjmp_iso.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_LONGJMP_NORETURN_CHECK )
extern void longjmp(jmp_buf, int) __attribute__ ((__noreturn__));
#endif /* SOLARIS_LONGJMP_NORETURN_CHECK */
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/iso/stdio_iso.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_GETC_STRICT_STDC_CHECK )
#if !defined(_REENTRANT) && !defined(_LP64) && (!defined(_STRICT_STDC) || (__cplusplus >= 199711L))
#endif /* SOLARIS_GETC_STRICT_STDC_CHECK */
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/iso/stdlib_iso.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_CXX_LINKAGE_CHECK )
#if __cplusplus >= 199711L && !__GNUG__
extern "C++" {
void *bsearch(const void *, const void *, size_t, size_t,
#endif /* SOLARIS_CXX_LINKAGE_CHECK */
......@@ -65,6 +65,16 @@ extern int rename(const char *_old, const char *_new);
#endif /* RS6000_PARAM_CHECK */
#if defined( SOLARIS_STD___FILBUF_CHECK )
using std::perror;
#ifndef _LP64
using std::__filbuf;
using std::__flsbuf;
#endif
#endif
#endif /* SOLARIS_STD___FILBUF_CHECK */
#if defined( STDIO_STDARG_H_CHECK )
#endif /* STDIO_STDARG_H_CHECK */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment