GNOME Bugzilla – Bug 378779
G_OS_WIN32 defined when compiling only; what about other software?!
Last modified: 2006-11-24 10:33:49 UTC
Please describe the problem: When I do ./configure for glib, it generates a file called glib/glibconfig.h. This file includes a definition of for G_OS_WIN32 (and G_PLATFORM_WIN32--not too sure what the difference?). That means the entire library is compiled with both flags #define'd. The HUGE problem that I can see is that all the other software compiled against the glib MUST have these two flags set too or some functions, structures, macros may not be equal and the library (or Gtk... ha!) would crash, it seems to me. Obviously, I can add that to my command line since most other packages will accept a CFLAGS=-DG_OS_WIN32 definition. But I do not think that this is the right way to proceed. Instead, I'd like to get these two flags in some gconfig.h file saved under /mingw/include/glib/* I'd be glad to make that work for you guys, but I first need to make sure that you will accept my changes. Thank you. Alexis Wilke Steps to reproduce: 1. grep G_OS_WIN32 /mingw/include/glib/*.* /mingw/include/glib/*/*.* 2. search for a #define 3. you cannot find it... try again? 8-) Actual results: Expected results: Does this happen every time? Other information:
If you cannot find the G_OS_WIN32 defined in your headers you have a buggy development environment. Where did you get your GLib development environment from? Complain loudly to them. G_OS_WIN32 is defined in lib/glib-2.0/include/glibconfig.h in all the official glib Win32 development packages (glib-dev-*.zip files) distributed from ftp.gtk.org and ftp.gnome.org (and earlier, from www.gimp.org).
And FYI: The difference between G_OS_WIN32 and G_PLATFORM_WIN32 is that for Cygwin, G_OS_WIN32 is not defined (but G_OS_UNIX is). G_PLATFORM_WIN32 is defined for Cygwin, though. The actual usefulness of this is not necessarily that great. Presumably, if GLib was built for something like Interix, the same would hold for it as for Cygwin.
Ah! I found it! It's hidden in the lib/glib-2.0/include folder. It works... never mind!