summaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-08-10 08:43:38 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-08-10 08:43:38 +0000
commitd62bab6a7c366d625c1f31903ec971f4e5f1349e (patch)
tree1e5807e498bbed185aa86e1f8e341a631b04bddf /fixincludes/inclhack.def
parent693ed633816d191104a804686043a02146c34d8e (diff)
downloadgcc-d62bab6a7c366d625c1f31903ec971f4e5f1349e.tar.gz
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
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r--fixincludes/inclhack.def92
1 files changed, 92 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index df6d1a955ff..d538706156a 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -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.