GNOME Bugzilla – Bug 731625
Improve test for darwin printf format-strings
Last modified: 2017-11-03 20:21:20 UTC
glib-2.40.0 (and same in git master) glib/tests/gdatetime.c test_non_utf8_printf uses HAVE_CARBON to determine whether to run some additional tests. These TEST_PRINTF have comments that they excercise some g_date_time_format format-strings that are specific to OS X. However, "carbon" is long-deprecated on OS X. The glib functions don't seem to use carbon to handle the format-string, and OS X has that function at a much lower level too. If this is supposed to be "for OS X", would be better to control it by an actual platform-test for...I guess darwin. There's no G_* token for this platform situation, but would be easy enough for configure to set it based on $host like is done for various unix and win32 situations. Should it be G_OS_DARWIN or G_PLATFORM_DARWIN? There is G_OS_UNIX and both G_OS_WIN32 and G_PLATFORM_WIN32.
Neither. Just use whatever the darwin equivalent of "#ifdef __linux__" is.
Ah yes, even better than having to propagate Yet Another token:) Looks like __APPLE__ is the analogous one (it is indeed defined by the clang compiler) https://developer.apple.com/library/mac/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html
Created attachment 278424 [details] [review] HAVE_CARBON -> __APPLE__
ping? Still seems to be present (and the solution sensible to me) against 2.44.0
Review of attachment 278424 [details] [review]: Sure. Sorry for the delay.