[80063] trunk/dports/devel/gperf

jeremyhu at macports.org jeremyhu at macports.org
Sun Jul 3 10:25:50 PDT 2011


Revision: 80063
          http://trac.macports.org/changeset/80063
Author:   jeremyhu at macports.org
Date:     2011-07-03 10:25:49 -0700 (Sun, 03 Jul 2011)
Log Message:
-----------
gperf: Fix generated code for compilation with C99 compilers like clang

Modified Paths:
--------------
    trunk/dports/devel/gperf/Portfile

Added Paths:
-----------
    trunk/dports/devel/gperf/files/
    trunk/dports/devel/gperf/files/c99.patch

Modified: trunk/dports/devel/gperf/Portfile
===================================================================
--- trunk/dports/devel/gperf/Portfile	2011-07-03 17:02:46 UTC (rev 80062)
+++ trunk/dports/devel/gperf/Portfile	2011-07-03 17:25:49 UTC (rev 80063)
@@ -18,6 +18,8 @@
 
 configure.args		--infodir=${prefix}/share/info
 
+patchfiles              c99.patch
+
 test.run		yes
 test.target		check
 

Added: trunk/dports/devel/gperf/files/c99.patch
===================================================================
--- trunk/dports/devel/gperf/files/c99.patch	                        (rev 0)
+++ trunk/dports/devel/gperf/files/c99.patch	2011-07-03 17:25:49 UTC (rev 80063)
@@ -0,0 +1,39 @@
+--- src/output.cc.orig	2011-07-03 10:13:13.000000000 -0700
++++ src/output.cc	2011-07-03 10:17:43.000000000 -0700
+@@ -745,12 +745,12 @@ Output::output_hash_function () const
+   if (option[CPLUSPLUS])
+     printf ("inline ");
+   else if (option[KRC] | option[C] | option[ANSIC])
+-    printf ("#ifdef __GNUC__\n"
++    printf ("#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC_STDC_INLINE__)\n"
++            "static inline\n"
++            "#elif defined(__GNUC__)\n"
+             "__inline\n"
+-            "#else\n"
+-            "#ifdef __cplusplus\n"
++            "#elif defined(__cplusplus)\n"
+             "inline\n"
+-            "#endif\n"
+             "#endif\n");
+ 
+   if (/* The function does not use the 'str' argument?  */
+@@ -1892,12 +1892,13 @@ Output::output_lookup_function () const
+          warning: C99 inline functions are not supported; using GNU89
+          warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+        It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.  */
+-    printf ("#ifdef __GNUC__\n"
+-            "__inline\n"
+-            "#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__\n"
+-            "__attribute__ ((__gnu_inline__))\n"
+-            "#endif\n"
+-            "#endif\n");
++   printf ("#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC_STDC_INLINE__)\n"
++           "static inline\n"
++           "#elif defined(__GNUC__)\n"
++           "__inline\n"
++           "#elif defined(__cplusplus)\n"
++           "inline\n"
++           "#endif\n");
+ 
+   printf ("%s%s\n",
+           const_for_struct, _return_type);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110703/6975e075/attachment.html>


More information about the macports-changes mailing list