Code

Define fallback PATH_MAX on systems that do not define one in <limits.h>
authorJunio C Hamano <junkio@cox.net>
Sat, 16 Sep 2006 05:47:21 +0000 (22:47 -0700)
committerJunio C Hamano <junkio@cox.net>
Sat, 16 Sep 2006 05:47:21 +0000 (22:47 -0700)
Notably on GNU/Hurd, as reported by Gerrit Pape.

Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin.h
git-compat-util.h

index 25431d70816634cec4ca6c54dc670ac536246277..398eafbf995e4bf7a999ea9ff0e573c55e39790b 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -1,8 +1,7 @@
 #ifndef BUILTIN_H
 #define BUILTIN_H
 
-#include <stdio.h>
-#include <limits.h>
+#include "git-compat-util.h"
 
 extern const char git_version_string[];
 extern const char git_usage_string[];
index 552b8ec23a1a927208f1ed4c48d08b513d8572c5..0272d043d0b82dc6ad0ff4836fe8db8ed1e1d960 100644 (file)
 #include <sys/types.h>
 #include <dirent.h>
 
+/* On most systems <limits.h> would have given us this, but
+ * not on some systems (e.g. GNU/Hurd).
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else