While using the XDR routines supplied by the macOS SDK, I am getting a build error stating that "xdr_u_long" does not take a u_long type as an argument but instead takes an unsigned int. After looking at the header file, there are two declarations of "xdr_u_long":
#ifdef __LP64__
extern bool_t xdr_long(XDR *, int *);
extern bool_t xdr_u_long(XDR *, unsigned int *);
#else
extern bool_t xdr_long(XDR *, long *);
extern bool_t xdr_u_long(XDR *, unsigned long *);
#endif
Should this compiler macro be the opposite of what it is? On a 32-bit machine ints and longs use the same number of bytes, so int and unsigned int would suffice. On a 64-bit machine this is not the case, so this seems a bit backwards to me. Is there a reason why on a 64 bit machine you would want a u_long to be an unsigned int?
Post
Replies
Boosts
Views
Activity
I have a project that previously built for x86_64 that includes
objective C, C and C++ files using Xcode 11.7. I am now trying to
upgrade my project so that it will build for both arm64 and x86_64 using
xcode 12.4. However, when I attempt to build, I receive many errors
relating to missing "CTYPE"s as well as functions missing from the
global namespace.
/Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:53:24: Use of undeclared identifier '_CTYPE_A'
/Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:53:33: Use of undeclared identifier '_CTYPE_D'
/Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:71:10: Use of undeclared identifier '__istype'
/Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:89:24: Use of undeclared identifier '_CTYPE_L'
/Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:125:17: Use of undeclared identifier '__tolower'; did you mean 'towlower'?
/Applications/Xcode12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:103:9: No member named 'isalnum' in the global namespace; did you mean 'iswalnum'?
/Applications/Xcode12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:104:9: No member named 'isalpha' in the global namespace; did you mean 'iswalpha'?
There are more errors than this present but this is the gist of what I
am seeing. It should be noted that as far as I can tell I am not using
any of the functions or definitions in my code and that these errors
seem to be from functions and definitions deep in the SDK.
Is there anything I should be looking for in particular to resolve these build errors? Do I need to change a project setting?