Re: [AD] [WIN] HMONITOR_DECLARED

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> no problemo, i'll have that fixed...
> i don't know why the mingw compiler reacts on this though. if
> MHONITOR_DECLARED is defined as something then it is for sure defined.

because almgw32.h get processed BEFORE windef.h, and so, the redefinition
is done in the mingw32 header, no in the allegro header, so what the
preprocessor does is:

#ifndef HMONITOR_DECLARED   // since we have NOT declared it yet, we cotinue
  #define HMONITOR_DECLARED   // ok, now HMONITOR_DECLARED is defined
#endif

and then, after almgw32.h comes the included windef.h, that does, directly
without checking
#define HMONITOR_DECLARED 1 // warning! warning! redefinition!

that's why
another possible solution could be to include <windef.h> or <windows.h>
before that allegro check

since if we dont do that, allegro will be defining his own HMONITOR_DECLARED
all the time, i think the last proposed fix is the better



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/