diff --git a/src/tools/fs_shell/posix_compatibility.h b/src/tools/fs_shell/posix_compatibility.h index d5693f0b60..07677ba88c 100644 --- a/src/tools/fs_shell/posix_compatibility.h +++ b/src/tools/fs_shell/posix_compatibility.h @@ -5,13 +5,19 @@ #ifndef _FSSH_POSIX_COMPATIBILITY_H #define _FSSH_POSIX_COMPATIBILITY_H -// BeOS doesn't define [U]LLONG_{MIN,MAX}, but [U]LONGLONG_{MIN,MAX} #include -#ifndef LLONG_MIN -# define LLONG_MIN LONGLONG_MIN -# define LLONG_MAX LONGLONG_MAX -# define ULLONG_MAX ULONGLONG_MAX + +// BeOS doesn't define [U]LLONG_{MIN,MAX}, but [U]LONGLONG_{MIN,MAX}. +// And under some stupid Linux platforms we don't get the macros when +// compiling in C++ mode. +#ifndef LLONG_MAX +# ifdef LONGLONG_MAX + // define to the BeOS macro +# define LLONG_MAX LONGLONG_MAX +# else + // minimum acceptable value as per standard +# define LLONG_MAX (9223372036854775807LL) +# endif #endif #endif // _FSSH_POSIX_COMPATIBILITY_H -