13
0

Move the preprocessor directive GTKMM_ATKMM_ENABLED so it'll get #defined at an earlier stage

When building any program that uses Gtkmm (with Atkmm support) ALL modules need to agree about the status of GTKMM_ATKMM_ENABLED. Otherwise 'Gtk::Widget' can have different sizes in different modules. If that happens we can end up with all manner of inexplicable run-time crashes and hangs.

GTKMM_ATKMM_ENABLED gets #defined in 'gtkmmconfig.h'. So let's #include that file at the earliest possible opportunity (where we know it'll then have a consistent value for every compilation unit).
This commit is contained in:
John Emmas 2015-11-23 16:28:43 +00:00
parent 7eddc61a30
commit bb520c26ad

View File

@ -64,6 +64,15 @@ __declspec(selectany) int _forceAtlDllManifestRTM;
implementation for commonly used integer types. */ implementation for commonly used integer types. */
#include <stdint.h> #include <stdint.h>
/* When building Gtkmm with Atkmm support, ALL modules need
to agree about the status of GTKMM_ATKMM_ENABLED. Otherwise
we end up with all manner of imexplicable run time crashes
and hangs (due to Gtk::Widget having different sizes in
different modules). GTKMM_ATKMM_ENABLED gets #defined in
'gtkmmconfig.h'. So let's #include that file here, where
we know it'll get #included for every compilation unit. */
#include <gtkmmconfig.h>
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__) #if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
/* Define these libraries as getting built as DLLs */ /* Define these libraries as getting built as DLLs */
#define LIBAUDIOGRAPHER_DLL #define LIBAUDIOGRAPHER_DLL