From 8d285a7cc45dc782a147bbb9e2a4530839ecc8d7 Mon Sep 17 00:00:00 2001 From: Zhaosheng Pan Date: Tue, 6 Aug 2024 12:15:07 +0800 Subject: [PATCH] fix(macro)!: fix redefinition of macros on Windows (fixes #14) --- include/wave.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/wave.h b/include/wave.h index fb1f291..cd8084f 100644 --- a/include/wave.h +++ b/include/wave.h @@ -78,11 +78,27 @@ enum { }; /* wave file format codes */ + +// Windows already has these macros in mmreg.h +#if !((defined(_WIN32) || defined(_WIN64)) && defined(WAVE_FORMAT_PCM)) #define WAVE_FORMAT_PCM ((WaveU16)0x0001) +#endif + +#if !((defined(_WIN32) || defined(_WIN64)) && defined(WAVE_FORMAT_IEEE_FLOAT)) #define WAVE_FORMAT_IEEE_FLOAT ((WaveU16)0x0003) +#endif + +#if !((defined(_WIN32) || defined(_WIN64)) && defined(WAVE_FORMAT_ALAW)) #define WAVE_FORMAT_ALAW ((WaveU16)0x0006) +#endif + +#if !((defined(_WIN32) || defined(_WIN64)) && defined(WAVE_FORMAT_MULAW)) #define WAVE_FORMAT_MULAW ((WaveU16)0x0007) +#endif + +#if !((defined(_WIN32) || defined(_WIN64)) && defined(WAVE_FORMAT_EXTENSIBLE)) #define WAVE_FORMAT_EXTENSIBLE ((WaveU16)0xfffe) +#endif typedef enum { WAVE_OK, /** no error */