+ * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in
+ * extern "C" instead so libstdc++ can use it.
+ */
+fix = {
+ hackname = solaris_complex_cxx;
+ mach = "*-*-solaris2.*";
+ files = complex.h;
+ sed = "/#if[ \t]*!defined(__cplusplus)/c\\\n"
+ "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif";
+ sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n"
+ "#ifdef\t__cplusplus\\\n}\\\n#endif";
+ test_text = "#if !defined(__cplusplus)\n"
+ "#endif /* !defined(__cplusplus) */";
+};
+
+
+/*
+ * Solaris 8 PTHREAD_COND_INITIALIZER lacks the __pthread_cond_magic field.
+ * COND_MAGIC is only defined in <synch.h> and pollutes the namespace, so
+ * use the value literally instead.
+ */
+fix = {
+ hackname = solaris_cond_init;
+ select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+ files = pthread.h;
+ mach = '*-*-solaris2.8';
+ c_fix = format;
+ c_fix_arg = "%1, 0x4356%2";
+ c_fix_arg = "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+"
+ "\\{.*0)(\\},[ \t]*0\\}.*)$";
+ test_text =
+ '#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"'"\n"
+ '#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* = DEFAULTCV */';
+};
+
+
+/*
+ * 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);";
+};
+
+
+/*