Commits

Pierre Joye committed 6bdf216

portable max path len

Comments (0)

Files changed (2)

 #ifndef GD_INTERN_H
 #define GD_INTERN_H
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
 #endif
 #define MAX3(a,b,c) ((a)<(b)?(MAX(b,c)):(MAX(a,c)))
 
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+#  define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+#  define MAXPATHLEN MAX_PATH
+# else
+#  define MAXPATHLEN 256    /* Should be safe for any weird systems that do not define it */
+# endif
+#endif
+
 #endif
 
 #include "gd.h"
 #include "gdhelpers.h"
 #include "entities.h"
+#include "gd_intern.h"
 
 /* 2.0.10: WIN32, not MSWIN32 */
 #if !defined(_WIN32) && !defined(_WIN32_WCE)