[Mesa-dev] [PATCH] hurd: Fix build

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Nov 13 23:30:46 UTC 2016


GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
limitation. This works around it in arbprogram.c and shaderapi.c by
defining PATH_MAX to an arbitrary value (4096, as on Linux).

Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
---
 src/mesa/main/arbprogram.c | 4 ++++
 src/mesa/main/shaderapi.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 9c7622a..175035d 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -46,6 +46,10 @@
 #define PATH_MAX _MAX_PATH
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 /**
  * Bind a program (make it current)
  * \note Called from the GL API dispatcher by both glBindProgramNV
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index be3c203..273fc9b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -65,6 +65,10 @@
 #define PATH_MAX _MAX_PATH
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 /**
  * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
  */
-- 
2.10.2



More information about the mesa-dev mailing list