Skip to content
Permalink
Browse files

recode: Fix build on Snow Leopard and earlier

  • Loading branch information
ryandesign committed Mar 11, 2018
1 parent 9ec787e commit 7f091b27e5e2d1f301647079f9f06c52e56558bb
Showing with 35 additions and 0 deletions.
  1. +5 −0 textproc/recode/Portfile
  2. +30 −0 textproc/recode/files/pragma.patch
@@ -28,6 +28,11 @@ depends_test port:py27-cython
depends_lib port:gettext \
port:libiconv

if {[string match *gcc* ${configure.compiler}]} {
patchfiles-append \
pragma.patch
}

post-destroot {
delete ${destroot}${prefix}/lib/charset.alias
delete ${destroot}${prefix}/share/info/dir
@@ -0,0 +1,30 @@
Fix "#pragma GCC diagnostic not allowed inside functions"
--- src/dump.c.orig 2018-01-30 08:58:01.000000000 -0600
+++ src/dump.c 2018-03-11 06:35:23.000000000 -0500
@@ -94,10 +94,7 @@

/* Write formatted value. */

-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
sprintf (buffer, format_table[base][byte_count], value);
-#pragma GCC diagnostic pop
for (cursor = buffer; *cursor; cursor++)
put_byte (*cursor, subtask);

--- src/names.c.orig 2018-01-30 15:57:53.000000000 -0600
+++ src/names.c 2018-03-11 06:34:30.000000000 -0500
@@ -905,13 +905,10 @@

/* FIXME: Trailing space elimination is not always effective. */

-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (ucs2 >= 0)
printf (format, code);
else if (mnemonic || counter2 != 112)
fputs (blanks, stdout);
-#pragma GCC diagnostic pop

if (mnemonic)
printf (counter2 == 112 ? " %s\n" : " %-3s", mnemonic);

0 comments on commit 7f091b2

Please sign in to comment.
You can’t perform that action at this time.