Re: [AD] Error compiling MinGW Allegro with Cygwin with w32api-3.8-1 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2006-12-19, Andrei Ellman <ae-a-alleg@xxxxxxxxxx> wrote:
> Hi,
>
> I've discovered an issue when compiling MinGW Allegro 4.2.1 with Cygwin
> with w32api-3.8-1 . If I downgrade to the w32api-3.7-1 package, the
> error goes away. Note that in both cases, I installed dx80_mgw.zip after
> I had installed the Cygwin package.
>
> Here's the output for the offending compilation (note: All files up
> until that point compiled just fine):
>
...
>
> I get the impression that mmsystem.h is the culprit. I did a diff
> between the one from the 3.7.1 and 3.8.1 files, and this is what it came
> up with:
>
> 194a194
> > #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
> 1012c1013,1014
> < #ifndef _WAVEFORMATEX_
> ---
> > #ifndef _LPCWAVEFORMATEX_DEFINED
> > #define _LPCWAVEFORMATEX_DEFINED
>
>
> The changelog is at
> http://cygwin.com/ml/cygwin-announce/2006-11/msg00039.html
> I believe the relevant entry to be:
>
> * include/mmsystem.h (_LPCWAVEFORMATEX_DEFINED): Define.
> Use as guard for the WAVEFORMATEX structure instead of
> _WAVEFORMATEX_ to avoid clashes with DirectSound. Keep
> _WAVEFORMATEX_ for compatibility.
>
>
> I'm not sure if this is a Cygwin or an Allegro related problem.
Thanks for the report. In include/allegro/platform/almngw32.h we find
the offending lines:
/* windows specific defines */
#if (defined ALLEGRO_SRC)
/* pathches to handle DX7 headers on a win9x system */
/* should WINNT be defined on win9x systems? */
#ifdef WINNT
#undef WINNT
#endif
/* defined in windef.h */
#ifndef HMONITOR_DECLARED
#define HMONITOR_DECLARED 1
#endif
/* already defined... */
#ifndef _LPCWAVEFORMATEX_DEFINED
#define _LPCWAVEFORMATEX_DEFINED
#endif
#endif /* ALLEGRO_SRC */
_LPCWAVEFORMATEX_DEFINED is unconditionally defined, and if that happens
before mmsystem.h is included then LPCWAVEFORMATEX is not typedef'd,
causing later errors in mmsystem.h.
I don't know what the reason for that define is. It seems to have been
added when the Mingw32 port was first added (r63 in SVN, path
allegro/trunk/include/allegro/almngw32.h). It might be possible just to
remove the offending lines now.
Peter