diff --git a/src/support/dirpath.h b/src/support/dirpath.h index 57c7927f14d55..b2314d571c649 100644 --- a/src/support/dirpath.h +++ b/src/support/dirpath.h @@ -6,14 +6,17 @@ #ifdef _OS_WINDOWS_ #define PATHSEPSTRING "\\" #define PATHLISTSEPSTRING ";" +#if defined(PATH_MAX) #define JL_PATH_MAX PATH_MAX -#if defined(_COMPILER_CLANG_) +#else // _COMPILER_CLANG_ may have the name reversed #define JL_PATH_MAX MAX_PATH #endif #else #define PATHSEPSTRING "/" #define PATHLISTSEPSTRING ":" -#ifndef JL_PATH_MAX // many platforms don't have a max path, we define one anyways +#if defined(PATH_MAX) +#define JL_PATH_MAX PATH_MAX +#else // many platforms don't have a max path, we define one anyways #define JL_PATH_MAX 1024 #endif #endif