Bug 412610 - "MAXPATHLEN too small for glibc's realpath()" (define MAXPATHLEN as PATH_MAX when PATH_MAX is available) [r=bsmedberg]

This commit is contained in:
Dmitry Potapov 2008-10-20 22:55:57 -05:00
Родитель cb7afa57ec
Коммит a455dc4471
5 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -58,9 +58,12 @@
#include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceUtils.h"
#include <stdlib.h> #include <stdlib.h>
#include <limits.h>
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
#ifdef _MAX_PATH #ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH #define MAXPATHLEN _MAX_PATH
#elif defined(CCHMAXPATH) #elif defined(CCHMAXPATH)
#define MAXPATHLEN CCHMAXPATH #define MAXPATHLEN CCHMAXPATH

Просмотреть файл

@ -63,12 +63,16 @@
#include <windows.h> #include <windows.h>
#include "nsIWindowsRegKey.h" #include "nsIWindowsRegKey.h"
#include "nsILocalFileWin.h" #include "nsILocalFileWin.h"
#else
#include <limits.h>
#endif #endif
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
#ifdef _MAX_PATH #ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH #define MAXPATHLEN _MAX_PATH
#elif defined(CCHMAXPATH) #elif defined(CCHMAXPATH)
#define MAXPATHLEN CCHMAXPATH #define MAXPATHLEN CCHMAXPATH

Просмотреть файл

@ -118,7 +118,9 @@ void LaunchChild(int argc, char **argv);
#endif #endif
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
# ifdef MAX_PATH # ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# elif defined(_MAX_PATH)
# define MAXPATHLEN MAX_PATH # define MAXPATHLEN MAX_PATH
# elif defined(_MAX_PATH) # elif defined(_MAX_PATH)
# define MAXPATHLEN _MAX_PATH # define MAXPATHLEN _MAX_PATH

Просмотреть файл

@ -40,10 +40,14 @@
#ifdef XP_WIN #ifdef XP_WIN
#include <windows.h> #include <windows.h>
#else
#include <limits.h>
#endif #endif
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
#ifdef _MAX_PATH #ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH #define MAXPATHLEN _MAX_PATH
#elif defined(CCHMAXPATH) #elif defined(CCHMAXPATH)
#define MAXPATHLEN CCHMAXPATH #define MAXPATHLEN CCHMAXPATH

Просмотреть файл

@ -231,6 +231,7 @@ NS_GetFrozenFunctions(XPCOMFunctions *entryPoints, const char* libraryPath);
#define XUL_DLL "libxul"MOZ_DLL_SUFFIX #define XUL_DLL "libxul"MOZ_DLL_SUFFIX
#else // Unix #else // Unix
#include <limits.h> // for PATH_MAX
#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX #define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX