GNOME Bugzilla – Bug 667290
tools: Include locale.h before any i18n headers.
Last modified: 2012-03-21 12:19:11 UTC
Created attachment 204608 [details] [review] patch .
Why not just put it in the header directly then? Which is what I've done now, since we seem to be doing that in -base as well. More generally, your commit message is again rather uninformative. It doesn't say *why* this is required, what breakage does it fix in which environment etc. commit 1aec7a3d72051ed28911e4732a527b81ecb4939b Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Thu Jan 5 00:30:30 2012 +0000 gst: include locale.h before any other i18n headers This is also how we do it in -base. https://bugzilla.gnome.org/show_bug.cgi?id=667290
*** Bug 667291 has been marked as a duplicate of this bug. ***
Indeed, the commit message should have been better. The issue was with Solaris. And in fact, it's not locale.h that is the real issues, but macros defined in header files included by locale.h that needs to be in before the other i18n stuff. These are the macros for X/Open level/standard and whether extensions to this is to be used or not. I believe it's stdlib.h that defines these based on compiler flags and defines set on the command line or before header inclusion. In any event, if stdlib.h isn't in before the other i18n include files, you'll end up with either a error message saying something about incompatible UNIX standards or it won't find prototypes for functions it needs because the chosen standard level is too low and/or extensions aren't used. Moving the include to the header sounds good though, and should achieve the same thing.