We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arraylist.c includes limits.h which when building for iOS/ARM, already defines SIZE_T_MAX:
arraylist.c
limits.h
SIZE_T_MAX
#if !defined(_ANSI_SOURCE) #ifdef __LP64__ #define LONG_BIT 64 #else /* !__LP64__ */ #define LONG_BIT 32 #endif /* __LP64__ */ #define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ #define WORD_BIT 32 #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) #define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ #define UQUAD_MAX ULLONG_MAX #define QUAD_MAX LLONG_MAX #define QUAD_MIN LLONG_MIN #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */ #endif /* !_ANSI_SOURCE */
The result is the following build error, when building for the iOS SDK:
CC arraylist.lo CC debug.lo CC json_c_version.lo arraylist.c:26:9: error: 'SIZE_T_MAX' macro redefined [-Werror,-Wmacro-redefined] #define SIZE_T_MAX UINT_MAX ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/arm/limits.h:101:9: note: previous definition is here #define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ ^ 1 error generated. make[1]: *** [arraylist.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [install-recursive] Error 1
The text was updated successfully, but these errors were encountered:
I believe this is an accurate fix:
diff --git arraylist.c arraylist.c index 8439cc2..ddeb8d4 100644 --- arraylist.c +++ arraylist.c @@ -22,6 +22,7 @@ # include <strings.h> #endif /* HAVE_STRINGS_H */ +#ifndef SIZE_T_MAX #if SIZEOF_SIZE_T == SIZEOF_INT #define SIZE_T_MAX UINT_MAX #elif SIZEOF_SIZE_T == SIZEOF_LONG @@ -31,6 +32,7 @@ #else #error Unable to determine size of size_t #endif +#endif #include "arraylist.h"
Sorry, something went wrong.
Issue #351: don't redefine SIZE_T_MAX if it's already defined.
95dff31
No branches or pull requests
arraylist.c
includeslimits.h
which when building for iOS/ARM, already definesSIZE_T_MAX
:The result is the following build error, when building for the iOS SDK:
The text was updated successfully, but these errors were encountered: