You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mame 0.226 fails to build on MacOS 10.8 and Xcode 5.x, due to compilation errors in file src/osd/modules/files/posixfile.cpp.
Here's one example:
In file included from ../../../../../src/osd/modules/file/posixfile.cpp:41:
In file included from ../../../../../src/osd/modules/file/posixfile.h:12:
In file included from ../../../../../src/osd/osdcore.h:17:
In file included from ../../../../../src/lib/util/strformat.h:174:
In file included from ../../../../../src/lib/util/vecstream.h:25:
In file included from /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/istream:163:
In file included from /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/ostream:140:
/opt/local/libexec/llvm-9.0/bin/../include/c++/v1/locale:1455:16: error: use of undeclared identifier 'snprintf_l'; did you mean 'vswprintf_l'?
int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
^
Root cause is the preprocessor logic within C header file /usr/include/xlocale/_stdio.h, determining whether additional stdio functions are defined. One of those being snprintf_l().
Findings:
In later MacOS/Xcode releases, the logic is #if __DARWIN_C_LEVEL >= 200112L || defined(__cplusplus). The latter condition ensures we don't have to worry about __DARWIN_C_LEVEL.
But under MacOS 10.8 and Xcode 5.x, the logic is simply #if __DARWIN_C_LEVEL >= 200112L, with no awareness of C++ code. This breaks the Mame build.
The fix is easy: Define _DARWIN_C_SOURCE in posixfile.cpp, before including any library headers:
Mame 0.226 fails to build on MacOS 10.8 and Xcode 5.x, due to compilation errors in file
src/osd/modules/files/posixfile.cpp
.Here's one example:
Root cause is the preprocessor logic within C header file
/usr/include/xlocale/_stdio.h
, determining whether additional stdio functions are defined. One of those beingsnprintf_l()
.Findings:
#if __DARWIN_C_LEVEL >= 200112L || defined(__cplusplus)
. The latter condition ensures we don't have to worry about__DARWIN_C_LEVEL
.#if __DARWIN_C_LEVEL >= 200112L
, with no awareness of C++ code. This breaks the Mame build.The fix is easy: Define
_DARWIN_C_SOURCE
inposixfile.cpp
, before including any library headers:I'll submit a pull request with the requested change.
The text was updated successfully, but these errors were encountered: