https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61649

            Bug ID: 61649
           Summary: fixincludes update for solaris___restrict in
                    sys/feature_tests.h on Illumos
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard at netbsd dot org

Created attachment 33031
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33031&action=edit
patch to existing fixincludes/inclhack.def from gcc-4.7.3

Due to an update to sys/feature_tests.h as indicated here
(https://illumos.org/issues/2941), Illumos has "broken" the fixincludes
solaris___restrict hack as is evident by the current result in
$PREFIX/gcc47/lib/.../include-fixed/sys/feature_tests.h

/*
 * The following macro defines a value for the ISO C99 restrict
 * keyword so that _RESTRICT_KYWD resolves to "restrict" if
 * an ISO C99 compiler is used and "" (null string) if any other
 * compiler is used. This allows for the use of single prototype
 * declarations regardless of compiler version.
 */
#if (defined(__STDC__) && defined(_STDC_C99)) && !defined(__cplusplus)
#ifdef __cplusplus
#define    _RESTRICT_KYWD    __restrict
#else
#define    _RESTRICT_KYWD    restrict
#endif
#else
#define    _RESTRICT_KYWD
#endif


The attached patch seem to work around this by allowing both the standard and
the Illumos forms to be updated.

The test/base/sys/feature_tests.h patch is as follows:
--- fixincludes/tests/base/sys/feature_tests.h.orig    2010-06-21
15:27:29.000000000 +0000
+++ fixincludes/tests/base/sys/feature_tests.h
@@ -10,6 +10,7 @@


 #if defined( SOLARIS___RESTRICT_CHECK )
+#if (defined(__STDC__) && defined(_STDC_C99))
 #ifdef __cplusplus
 #define    _RESTRICT_KYWD    __restrict
 #else

Reply via email to