Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Android build fix & CMake fix #2609
The declaration is just missing in the header, the problem is that the configure check just checks if the function is available at link-time, not if it's declared.
I know that the toolchain is a bit older, but we're still using that one.
@snikulov Well, the CMake thing has nothing todo with Android. The check for
I discovered the issue when checking whether the declaration of
You can of course do what you want, but I still consider it a lame "fix". It just disables the use of the function so instead you'll use a function that isn't thread-safe. A more proper fix would be to instead provide a private prototype to avoid the warning when the correct function is used!
The cmake fix is valid and I'll merge!
added a commit
this pull request
May 28, 2018
I believe a proper fix for this broken NDK would be as following (assuming I've understood this correctly):
1 - detect the lack of
#ifdef HAVE_NO_GETPWUID_R_PROTO int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); #endif
And yes, it figured out this:
It highlights this problem: only the configure script will define
I would prefer if the configure script defines name for the reverse: when the prototype is found to be missing as then we could be sure that only systems for which configure has detected a missing prototype would use this custom one.