#379 mmsystem.h - LPCWAVEFORMATEX typedef

Feature_requests
closed-fixed
Earnie Boyd
2006-04-19
2003-07-11
Andrew
No

The type definition for LPCWAVEFORMATEX in
mmsystem.h generates a warning when attempting to
compile an application using both DirectSound and the
MMSystem.

Wrapping it in a conditional preprocessor definition fixes
this:

#ifndef _LPCWAVEFORMATEX_DEFINED
#define _LPCWAVEFORMATEX_DEFINED
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
#endif

Discussion

    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=52414

    The problem you report has caused modification in some fashion in the official CVS for the given package. The w32api and
    mingw-runtime official CVS reside in the winsup CVS directory tree for Cygwin. Those package CVS trees are periodically
    merged into the MinGW CVS tree. If you still find problems then please open a new report.

     
  • Logged In: YES
    user_id=52414

    For the record, which is the DirectSound header that
    contains duplicate definitions for the WAVEFORMATEX
    structure? I understand DirectSound also protects the
    WAVEFORMATEX definition with _LPCWAVEFORMATEX_DEFINED,
    doesn't it?

    I'm asking because if you have a look at WAVEFORMATEX, it's
    already protected by _WAVEFORMATEX_! I don't understand why
    two different macro constants would be needed here.

    Anyway, I've looked into this issue using Google and it
    would appear _LPCWAVEFORMATEX_DEFINED is indeed more
    appropriate than _WAVEFORMATEX_ and does avoid clashes with
    DirectSound, so I'm adding _LPCWAVEFORMATEX_DEFINED as the
    primary guard and keeping _WAVEFORMATEX_ for compatibility.