Ticket #48471: gcc48-48471-151225.patch

File gcc48-48471-151225.patch, 13.9 KB (added by Serge3leo (Serguei E. Leontiev), 9 years ago)

Patch for dports/lang/gcc48 base at define_non_standard_clang_macros.patch

  • ./Portfile

    diff -Nur -x 'work*' ./Portfile /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/gcc48/./Portfile
    old new  
    5454# later (#45483).
    5555patchfiles-append   yosemite-libtool.patch
    5656
     57# https://trac.macports.org/ticket/48471
     58patchfiles-append   define_non_standard_clang_macros.patch
     59
    5760set major           [join [lrange [split ${version} .-] 0 1] .]
    5861
    5962platform darwin {
  • ./files/define_non_standard_clang_macros.patch

    diff -Nur -x 'work*' ./files/define_non_standard_clang_macros.patch /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/gcc48/./files/define_non_standard_clang_macros.patch
    old new  
     1--- fixincludes/inclhack.def.orig       2015-10-09 05:25:46.000000000 +0200
     2+++ fixincludes/inclhack.def    2015-10-09 05:27:23.000000000 +0200
     3@@ -1141,6 +1141,79 @@
     4     test_text = "#define _Noreturn     [[noreturn]]";
     5 };
     6 
     7+/*
     8+ * Add definitions of non-standard (clang) macros.
     9+ */
     10+fix = {
     11+    hackname  = clang_macro___has_builtin;
     12+    select    = "__has_builtin";
     13+    bypass    = "#[ \t]*define[ \t]+__has_builtin";
     14+    c_fix     = wrap;
     15+    c_fix_arg = "#ifndef __has_builtin\n"
     16+                "  #define __has_builtin(x) 0\n"
     17+                "#endif\n";
     18+    test_text = "#if __has_builtin(__builtin_trap)\n"
     19+                "  __builtin_trap();\n"
     20+                "#else\n"
     21+                "  abort();\n"
     22+                "#endif\n";
     23+};
     24+fix = {
     25+    hackname  = clang_macro___has_feature;
     26+    select    = "__has_feature";
     27+    bypass    = "#[ \t]*define[ \t]+__has_feature";
     28+    c_fix     = wrap;
     29+    c_fix_arg = "#ifndef __has_feature\n"
     30+                "  #define __has_feature(x) 0\n"
     31+                "#endif\n";
     32+    test_text = "#if __has_feature(cxx_rvalue_references)\n"
     33+                "  // This code will only be compiled with the -std=c++11 and -std=gnu++11\n"
     34+                "  // options, because rvalue references are only standardized in C++11.\n"
     35+                "#endif\n";
     36+};
     37+fix = {
     38+    hackname  = clang_macro___has_cpp_attribute;
     39+    select    = "__has_cpp_attribute";
     40+    bypass    = "#[ \t]*define[ \t]+__has_cpp_attribute";
     41+    c_fix     = wrap;
     42+    c_fix_arg = "#ifndef __has_cpp_attribute\n"
     43+                "  #define __has_cpp_attribute(x) 0\n"
     44+                "#endif\n";
     45+    test_text = "#if __has_cpp_attribute(clang::fallthrough)\n"
     46+                "  #define FALLTHROUGH [[clang::fallthrough]]\n"
     47+                "#else\n"
     48+                "  #define FALLTHROUGH\n"
     49+                "#endif\n";
     50+};
     51+fix = {
     52+    hackname  = clang_macro___has_attribute;
     53+    select    = "__has_attribute";
     54+    bypass    = "#[ \t]*define[ \t]+__has_attribute";
     55+    c_fix     = wrap;
     56+    c_fix_arg = "#ifndef __has_attribute\n"
     57+                "  #define __has_attribute(x) 0\n"
     58+                "#endif\n";
     59+    test_text = "#if __has_attribute(always_inline)\n"
     60+                "  #define ALWAYS_INLINE __attribute__((always_inline))\n"
     61+                "#else\n"
     62+                "  #define ALWAYS_INLINE\n"
     63+                "#endif\n";
     64+};
     65+fix = {
     66+    hackname  = clang_macro___has_declspec_attribute;
     67+    select    = "__has_declspec_attribute";
     68+    bypass    = "#[ \t]*define[ \t]+__has_declspec_attribute";
     69+    c_fix     = wrap;
     70+    c_fix_arg = "#ifndef __has_declspec_attribute\n"
     71+                "  #define __has_declspec_attribute(x) 0\n"
     72+                "#endif\n";
     73+    test_text = "#if __has_declspec_attribute(dllexport)\n"
     74+                "  #define DLLEXPORT __declspec(dllexport)\n"
     75+                "#else\n"
     76+                "  #define DLLEXPORT\n"
     77+                "#endif\n";
     78+};
     79+
     80 /*
     81  *  Fix various macros used to define ioctl numbers.
     82  *  The traditional syntax was:
     83--- fixincludes/fixincl.x.orig  2015-10-09 05:26:14.000000000 +0200
     84+++ fixincludes/fixincl.x       2015-10-09 05:27:32.000000000 +0200
     85@@ -1,12 +1,12 @@
     86 /*  -*- buffer-read-only: t -*- vi: set ro:
     87- *
     88+ *
     89  * DO NOT EDIT THIS FILE   (fixincl.x)
     90- *
     91- * It has been AutoGen-ed  December 13, 2014 at 05:31:32 AM by AutoGen 5.12
     92+ *
     93+ * It has been AutoGen-ed
     94  * From the definitions    inclhack.def
     95  * and the template file   fixincl
     96  */
     97-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Dec 13 05:31:32 PST 2014
     98+/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Oct  9 05:27:32 CEST 2015
     99  *
     100  * You must regenerate it.  Use the ./genfixes script.
     101  *
     102@@ -15,7 +15,7 @@
     103  * certain ANSI-incompatible system header files which are fixed to work
     104  * correctly with ANSI C and placed in a directory that GNU C will search.
     105  *
     106- * This file contains 227 fixup descriptions.
     107+ * This file contains 232 fixup descriptions.
     108  *
     109  * See README for more information.
     110  *
     111@@ -2092,6 +2092,221 @@
     112 
     113 /* * * * * * * * * * * * * * * * * * * * * * * * * *
     114  *
     115+ *  Description of Clang_Macro___Has_Builtin fix
     116+ */
     117+tSCC zClang_Macro___Has_BuiltinName[] =
     118+     "clang_macro___has_builtin";
     119+
     120+/*
     121+ *  File name selection pattern
     122+ */
     123+#define zClang_Macro___Has_BuiltinList (char*)NULL
     124+/*
     125+ *  Machine/OS name selection pattern
     126+ */
     127+#define apzClang_Macro___Has_BuiltinMachs (const char**)NULL
     128+
     129+/*
     130+ *  content selection pattern - do fix if pattern found
     131+ */
     132+tSCC zClang_Macro___Has_BuiltinSelect0[] =
     133+       "__has_builtin";
     134+
     135+/*
     136+ *  content bypass pattern - skip fix if pattern found
     137+ */
     138+tSCC zClang_Macro___Has_BuiltinBypass0[] =
     139+       "#[ \t]*define[ \t]+__has_builtin";
     140+
     141+#define    CLANG_MACRO___HAS_BUILTIN_TEST_CT  2
     142+static tTestDesc aClang_Macro___Has_BuiltinTests[] = {
     143+  { TT_NEGREP,   zClang_Macro___Has_BuiltinBypass0, (regex_t*)NULL },
     144+  { TT_EGREP,    zClang_Macro___Has_BuiltinSelect0, (regex_t*)NULL }, };
     145+
     146+/*
     147+ *  Fix Command Arguments for Clang_Macro___Has_Builtin
     148+ */
     149+static const char* apzClang_Macro___Has_BuiltinPatch[] = {
     150+    "wrap",
     151+    "#ifndef __has_builtin\n\
     152+  #define __has_builtin(x) 0\n\
     153+#endif\n",
     154+    (char*)NULL };
     155+
     156+/* * * * * * * * * * * * * * * * * * * * * * * * * *
     157+ *
     158+ *  Description of Clang_Macro___Has_Feature fix
     159+ */
     160+tSCC zClang_Macro___Has_FeatureName[] =
     161+     "clang_macro___has_feature";
     162+
     163+/*
     164+ *  File name selection pattern
     165+ */
     166+#define zClang_Macro___Has_FeatureList (char*)NULL
     167+/*
     168+ *  Machine/OS name selection pattern
     169+ */
     170+#define apzClang_Macro___Has_FeatureMachs (const char**)NULL
     171+
     172+/*
     173+ *  content selection pattern - do fix if pattern found
     174+ */
     175+tSCC zClang_Macro___Has_FeatureSelect0[] =
     176+       "__has_feature";
     177+
     178+/*
     179+ *  content bypass pattern - skip fix if pattern found
     180+ */
     181+tSCC zClang_Macro___Has_FeatureBypass0[] =
     182+       "#[ \t]*define[ \t]+__has_feature";
     183+
     184+#define    CLANG_MACRO___HAS_FEATURE_TEST_CT  2
     185+static tTestDesc aClang_Macro___Has_FeatureTests[] = {
     186+  { TT_NEGREP,   zClang_Macro___Has_FeatureBypass0, (regex_t*)NULL },
     187+  { TT_EGREP,    zClang_Macro___Has_FeatureSelect0, (regex_t*)NULL }, };
     188+
     189+/*
     190+ *  Fix Command Arguments for Clang_Macro___Has_Feature
     191+ */
     192+static const char* apzClang_Macro___Has_FeaturePatch[] = {
     193+    "wrap",
     194+    "#ifndef __has_feature\n\
     195+  #define __has_feature(x) 0\n\
     196+#endif\n",
     197+    (char*)NULL };
     198+
     199+/* * * * * * * * * * * * * * * * * * * * * * * * * *
     200+ *
     201+ *  Description of Clang_Macro___Has_Cpp_Attribute fix
     202+ */
     203+tSCC zClang_Macro___Has_Cpp_AttributeName[] =
     204+     "clang_macro___has_cpp_attribute";
     205+
     206+/*
     207+ *  File name selection pattern
     208+ */
     209+#define zClang_Macro___Has_Cpp_AttributeList (char*)NULL
     210+/*
     211+ *  Machine/OS name selection pattern
     212+ */
     213+#define apzClang_Macro___Has_Cpp_AttributeMachs (const char**)NULL
     214+
     215+/*
     216+ *  content selection pattern - do fix if pattern found
     217+ */
     218+tSCC zClang_Macro___Has_Cpp_AttributeSelect0[] =
     219+       "__has_cpp_attribute";
     220+
     221+/*
     222+ *  content bypass pattern - skip fix if pattern found
     223+ */
     224+tSCC zClang_Macro___Has_Cpp_AttributeBypass0[] =
     225+       "#[ \t]*define[ \t]+__has_cpp_attribute";
     226+
     227+#define    CLANG_MACRO___HAS_CPP_ATTRIBUTE_TEST_CT  2
     228+static tTestDesc aClang_Macro___Has_Cpp_AttributeTests[] = {
     229+  { TT_NEGREP,   zClang_Macro___Has_Cpp_AttributeBypass0, (regex_t*)NULL },
     230+  { TT_EGREP,    zClang_Macro___Has_Cpp_AttributeSelect0, (regex_t*)NULL }, };
     231+
     232+/*
     233+ *  Fix Command Arguments for Clang_Macro___Has_Cpp_Attribute
     234+ */
     235+static const char* apzClang_Macro___Has_Cpp_AttributePatch[] = {
     236+    "wrap",
     237+    "#ifndef __has_cpp_attribute\n\
     238+  #define __has_cpp_attribute(x) 0\n\
     239+#endif\n",
     240+    (char*)NULL };
     241+
     242+/* * * * * * * * * * * * * * * * * * * * * * * * * *
     243+ *
     244+ *  Description of Clang_Macro___Has_Attribute fix
     245+ */
     246+tSCC zClang_Macro___Has_AttributeName[] =
     247+     "clang_macro___has_attribute";
     248+
     249+/*
     250+ *  File name selection pattern
     251+ */
     252+#define zClang_Macro___Has_AttributeList (char*)NULL
     253+/*
     254+ *  Machine/OS name selection pattern
     255+ */
     256+#define apzClang_Macro___Has_AttributeMachs (const char**)NULL
     257+
     258+/*
     259+ *  content selection pattern - do fix if pattern found
     260+ */
     261+tSCC zClang_Macro___Has_AttributeSelect0[] =
     262+       "__has_attribute";
     263+
     264+/*
     265+ *  content bypass pattern - skip fix if pattern found
     266+ */
     267+tSCC zClang_Macro___Has_AttributeBypass0[] =
     268+       "#[ \t]*define[ \t]+__has_attribute";
     269+
     270+#define    CLANG_MACRO___HAS_ATTRIBUTE_TEST_CT  2
     271+static tTestDesc aClang_Macro___Has_AttributeTests[] = {
     272+  { TT_NEGREP,   zClang_Macro___Has_AttributeBypass0, (regex_t*)NULL },
     273+  { TT_EGREP,    zClang_Macro___Has_AttributeSelect0, (regex_t*)NULL }, };
     274+
     275+/*
     276+ *  Fix Command Arguments for Clang_Macro___Has_Attribute
     277+ */
     278+static const char* apzClang_Macro___Has_AttributePatch[] = {
     279+    "wrap",
     280+    "#ifndef __has_attribute\n\
     281+  #define __has_attribute(x) 0\n\
     282+#endif\n",
     283+    (char*)NULL };
     284+
     285+/* * * * * * * * * * * * * * * * * * * * * * * * * *
     286+ *
     287+ *  Description of Clang_Macro___Has_Declspec_Attribute fix
     288+ */
     289+tSCC zClang_Macro___Has_Declspec_AttributeName[] =
     290+     "clang_macro___has_declspec_attribute";
     291+
     292+/*
     293+ *  File name selection pattern
     294+ */
     295+#define zClang_Macro___Has_Declspec_AttributeList (char*)NULL
     296+/*
     297+ *  Machine/OS name selection pattern
     298+ */
     299+#define apzClang_Macro___Has_Declspec_AttributeMachs (const char**)NULL
     300+
     301+/*
     302+ *  content selection pattern - do fix if pattern found
     303+ */
     304+tSCC zClang_Macro___Has_Declspec_AttributeSelect0[] =
     305+       "__has_declspec_attribute";
     306+
     307+/*
     308+ *  content bypass pattern - skip fix if pattern found
     309+ */
     310+tSCC zClang_Macro___Has_Declspec_AttributeBypass0[] =
     311+       "#[ \t]*define[ \t]+__has_declspec_attribute";
     312+
     313+#define    CLANG_MACRO___HAS_DECLSPEC_ATTRIBUTE_TEST_CT  2
     314+static tTestDesc aClang_Macro___Has_Declspec_AttributeTests[] = {
     315+  { TT_NEGREP,   zClang_Macro___Has_Declspec_AttributeBypass0, (regex_t*)NULL },
     316+  { TT_EGREP,    zClang_Macro___Has_Declspec_AttributeSelect0, (regex_t*)NULL }, };
     317+
     318+/*
     319+ *  Fix Command Arguments for Clang_Macro___Has_Declspec_Attribute
     320+ */
     321+static const char* apzClang_Macro___Has_Declspec_AttributePatch[] = {
     322+    "wrap",
     323+    "#ifndef __has_declspec_attribute\n\
     324+  #define __has_declspec_attribute(x) 0\n\
     325+#endif\n",
     326+    (char*)NULL };
     327+
     328+/* * * * * * * * * * * * * * * * * * * * * * * * * *
     329+ *
     330  *  Description of Ctrl_Quotes_Def fix
     331  */
     332 tSCC zCtrl_Quotes_DefName[] =
     333@@ -9304,9 +9519,9 @@
     334  *
     335  *  List of all fixes
     336  */
     337-#define REGEX_COUNT          265
     338+#define REGEX_COUNT          275
     339 #define MACH_LIST_SIZE_LIMIT 187
     340-#define FIX_COUNT            227
     341+#define FIX_COUNT            232
     342 
     343 /*
     344  *  Enumerate the fixes
     345@@ -9359,6 +9574,11 @@
     346     BROKEN_NAN_FIXIDX,
     347     BSD_STDIO_ATTRS_CONFLICT_FIXIDX,
     348     CDEF_CPLUSPLUS_FIXIDX,
     349+    CLANG_MACRO___HAS_BUILTIN_FIXIDX,
     350+    CLANG_MACRO___HAS_FEATURE_FIXIDX,
     351+    CLANG_MACRO___HAS_CPP_ATTRIBUTE_FIXIDX,
     352+    CLANG_MACRO___HAS_ATTRIBUTE_FIXIDX,
     353+    CLANG_MACRO___HAS_DECLSPEC_ATTRIBUTE_FIXIDX,
     354     CTRL_QUOTES_DEF_FIXIDX,
     355     CTRL_QUOTES_USE_FIXIDX,
     356     CXX_UNREADY_FIXIDX,
     357@@ -9777,6 +9997,31 @@
     358      CDEF_CPLUSPLUS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     359      aCdef_CplusplusTests,   apzCdef_CplusplusPatch, 0 },
     360 
     361+  {  zClang_Macro___Has_BuiltinName,    zClang_Macro___Has_BuiltinList,
     362+     apzClang_Macro___Has_BuiltinMachs,
     363+     CLANG_MACRO___HAS_BUILTIN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     364+     aClang_Macro___Has_BuiltinTests,   apzClang_Macro___Has_BuiltinPatch, 0 },
     365+
     366+  {  zClang_Macro___Has_FeatureName,    zClang_Macro___Has_FeatureList,
     367+     apzClang_Macro___Has_FeatureMachs,
     368+     CLANG_MACRO___HAS_FEATURE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     369+     aClang_Macro___Has_FeatureTests,   apzClang_Macro___Has_FeaturePatch, 0 },
     370+
     371+  {  zClang_Macro___Has_Cpp_AttributeName,    zClang_Macro___Has_Cpp_AttributeList,
     372+     apzClang_Macro___Has_Cpp_AttributeMachs,
     373+     CLANG_MACRO___HAS_CPP_ATTRIBUTE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     374+     aClang_Macro___Has_Cpp_AttributeTests,   apzClang_Macro___Has_Cpp_AttributePatch, 0 },
     375+
     376+  {  zClang_Macro___Has_AttributeName,    zClang_Macro___Has_AttributeList,
     377+     apzClang_Macro___Has_AttributeMachs,
     378+     CLANG_MACRO___HAS_ATTRIBUTE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     379+     aClang_Macro___Has_AttributeTests,   apzClang_Macro___Has_AttributePatch, 0 },
     380+
     381+  {  zClang_Macro___Has_Declspec_AttributeName,    zClang_Macro___Has_Declspec_AttributeList,
     382+     apzClang_Macro___Has_Declspec_AttributeMachs,
     383+     CLANG_MACRO___HAS_DECLSPEC_ATTRIBUTE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
     384+     aClang_Macro___Has_Declspec_AttributeTests,   apzClang_Macro___Has_Declspec_AttributePatch, 0 },
     385+
     386   {  zCtrl_Quotes_DefName,    zCtrl_Quotes_DefList,
     387      apzCtrl_Quotes_DefMachs,
     388      CTRL_QUOTES_DEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,