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 742957 - _NL_ADDRESS_POSTAL_FMT is declared by glibc, not gcc
_NL_ADDRESS_POSTAL_FMT is declared by glibc, not gcc
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
3.15.x
Other FreeBSD
: Normal normal
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-15 08:29 UTC by Ting-Wei Lan
Modified: 2015-01-15 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use __GLIBC__ when checking for GLIBC only feature (1.69 KB, patch)
2015-01-15 09:25 UTC, Jonas Danielsson
none Details | Review
Use __GLIBC__ when checking for GLIBC only feature (1.65 KB, patch)
2015-01-15 09:26 UTC, Jonas Danielsson
committed Details | Review

Description Ting-Wei Lan 2015-01-15 08:29:19 UTC
I found this commit https://git.gnome.org/browse/geocode-glib/commit/?id=005075f6a28c18f5196ba60ff07b888776af6dfc. It doesn't work because the constant _NL_ADDRESS_POSTAL_FMT is provided by glibc, but __GNUC__ can only be used to check gcc-compatible compilers. We use clang (which also defines __GNUC__) on FreeBSD, and it still fails because of _NL_ADDRESS_POSTAL_FMT.
Comment 1 Jonas Danielsson 2015-01-15 08:57:23 UTC
Thanks!

Do you now what define can be used to check for glibc?
Comment 2 Jonas Danielsson 2015-01-15 09:25:45 UTC
Created attachment 294578 [details] [review]
Use __GLIBC__ when checking for GLIBC only feature

The __GNUC__ macro is used to checking for gcc compatible compilers.
We should instead use __GLIBC__ to check for GLIBC only features.

This also adds the guard to the test, since it uses LC_ADDRESS.
Comment 3 Jonas Danielsson 2015-01-15 09:26:49 UTC
Created attachment 294579 [details] [review]
Use __GLIBC__ when checking for GLIBC only feature

The __GNUC__ macro is used to checking for gcc compatible compilers.
We should instead use __GLIBC__ to check for GLIBC only features.

This also adds the guard to the test, since it uses LC_ADDRESS.
Comment 4 Ting-Wei Lan 2015-01-15 10:04:24 UTC
Attachment 294579 [details] works.
Comment 5 Bastien Nocera 2015-01-15 12:38:06 UTC
Review of attachment 294579 [details] [review]:

Looks good.
Comment 6 Jonas Danielsson 2015-01-15 12:42:42 UTC
Comment on attachment 294579 [details] [review]
Use __GLIBC__ when checking for GLIBC only feature

Pushed to master