After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731625 - Improve test for darwin printf format-strings
Improve test for darwin printf format-strings
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.40.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-13 16:28 UTC by Daniel Macks
Modified: 2017-11-03 20:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
HAVE_CARBON -> __APPLE__ (2.17 KB, patch)
2014-06-13 19:21 UTC, Daniel Macks
committed Details | Review

Description Daniel Macks 2014-06-13 16:28:58 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.
Comment 1 Dan Winship 2014-06-13 16:35:26 UTC
Neither. Just use whatever the darwin equivalent of "#ifdef __linux__" is.
Comment 2 Daniel Macks 2014-06-13 17:07:13 UTC
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
Comment 3 Daniel Macks 2014-06-13 19:21:19 UTC
Created attachment 278424 [details] [review]
HAVE_CARBON -> __APPLE__
Comment 4 Daniel Macks 2015-04-23 05:07:23 UTC
ping? Still seems to be present (and the solution sensible to me) against 2.44.0
Comment 5 Philip Withnall 2017-11-03 20:19:43 UTC
Review of attachment 278424 [details] [review]:

Sure. Sorry for the delay.