Cherry-pick fix for bug 412610 (MAXPATHLEN)

This commit is contained in:
Henri Sivonen 2009-02-09 13:16:14 +02:00
parent ca80b70b7d
commit 8f98c4c732
5 changed files with 28 additions and 2 deletions

View File

@ -62,6 +62,7 @@
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# include <limits.h>
# define FILESEPARATOR '/'
# define FILESEPARATOR2 '\0'
# define CURRENT_DIR "/"
@ -105,7 +106,11 @@
#define utfstring "binary"
#define unicodestring "unicode"
#ifdef PATH_MAX
#define MAX_PATH_LENGTH PATH_MAX
#else
#define MAX_PATH_LENGTH 1024
#endif
#define MODE_SIZE 256
#define NUMBER_SIZE 32
#define MAX_LINE_LENGTH 256

View File

@ -203,6 +203,7 @@ typedef pthread_rwlock_t LCMS_RWLOCK_T;
#if defined(__GNUC__) || defined(__FreeBSD__)
# include <unistd.h>
# include <limits.h>
#endif
#ifndef LCMS_WIN_TYPES_ALREADY_DEFINED
@ -233,7 +234,11 @@ typedef void *LPVOID;
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#ifndef MAX_PATH
# define MAX_PATH (256)
# ifdef PATH_MAX
# define MAX_PATH PATH_MAX
# else
# define MAX_PATH (256)
# endif
#endif
#define cdecl

View File

@ -69,6 +69,10 @@
#include <Carbon/Carbon.h>
#endif
#ifdef XP_UNIX
#include <limits.h>
#endif
#ifdef STANDALONE_REGISTRY
#include <stdlib.h>
#include <assert.h>
@ -91,8 +95,12 @@
#define MAX_PATH PATH_MAX
#elif defined(XP_UNIX)
#ifndef MAX_PATH
#ifdef PATH_MAX
#define MAX_PATH PATH_MAX
#else
#define MAX_PATH 1024
#endif
#endif
#elif defined(XP_OS2)
#ifndef MAX_PATH
#define MAX_PATH 260

View File

@ -53,6 +53,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <limits.h>
#include <X11/Xatom.h>
#ifdef POLL_WITH_XCONNECTIONNUMBER
#include <poll.h>
@ -76,8 +77,12 @@
#endif
#ifndef MAX_PATH
#ifdef PATH_MAX
#define MAX_PATH PATH_MAX
#else
#define MAX_PATH 1024
#endif
#endif
#define ARRAY_LENGTH(array_) (sizeof(array_)/sizeof(array_[0]))

View File

@ -76,6 +76,7 @@
#elif defined(XP_UNIX)
#include <limits.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/param.h>
@ -100,7 +101,9 @@
#endif
#ifndef MAXPATHLEN
#ifdef MAX_PATH
#ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#elif defined(MAX_PATH)
#define MAXPATHLEN MAX_PATH
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH