[148447] trunk/dports/x11/mesa/files/static-strndup.patch
devans at macports.org
devans at macports.org
Sun May 8 16:53:46 PDT 2016
Revision: 148447
https://trac.macports.org/changeset/148447
Author: devans at macports.org
Date: 2016-05-08 16:53:45 -0700 (Sun, 08 May 2016)
Log Message:
-----------
mesa: add patch for src/compiler/glsl/linker.cpp to static-strndup.patch to fix 10.6 build (#51332).
Modified Paths:
--------------
trunk/dports/x11/mesa/files/static-strndup.patch
Modified: trunk/dports/x11/mesa/files/static-strndup.patch
===================================================================
--- trunk/dports/x11/mesa/files/static-strndup.patch 2016-05-08 14:35:41 UTC (rev 148446)
+++ trunk/dports/x11/mesa/files/static-strndup.patch 2016-05-08 23:53:45 UTC (rev 148447)
@@ -47,3 +47,30 @@
/* helper routine for strcat/strncat - n is the exact amount to copy */
+--- a/src/compiler/glsl/linker.cpp.orig 2016-05-08 16:23:12.000000000 -0700
++++ a/src/compiler/glsl/linker.cpp 2016-05-08 16:28:12.000000000 -0700
+@@ -518,6 +518,24 @@
+
+ } /* anonymous namespace */
+
++#undef strndup
++#define strndup __linker_strndup
++static char *
++strndup(const char *str, size_t n)
++{
++ size_t len;
++ char *copy;
++
++ for (len = 0; len < n && str[len]; len++)
++ continue;
++
++ if ((copy = (char *)malloc(len + 1)) == NULL)
++ return (NULL);
++ memcpy(copy, str, len);
++ copy[len] = '\0';
++ return (copy);
++}
++
+ void
+ linker_error(gl_shader_program *prog, const char *fmt, ...)
+ {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160508/00b17ad3/attachment.html>
More information about the macports-changes
mailing list