brglng / libwave

A simple C library for reading/writing PCM wave (.wav) files
Mozilla Public License 2.0
80 stars 20 forks source link

Visual Studio 2022: 'WAVE_FORMAT_PCM': macro redefinition #14

Closed djipi closed 2 months ago

djipi commented 3 months ago

When using the library, Visual Studio 2022 issue a warning. C:\SDK\WAV\libwave\include\wave.h(81,9): warning C4005: 'WAVE_FORMAT_PCM': macro redefinition

I wanted to report it as it is the only warning issued during the compilation, and I do not know if you track them.

brglng commented 3 months ago

Hi @djipi , it is sad that there is already a WAVE_FORMAT_PCM macro in Windows headers. I have to consider what the best way is to solve this issue. There may have to be a breakage of API.

djipi commented 3 months ago

Hi @brglng , well, it is unfortunate. But it looks like the Windows macro has the same value than your own. To avoid the redefinition, may be you can check if the define is already existing?

brglng commented 2 months ago

@djipi Please check if this issue is fixed in the latest commit.

djipi commented 2 months ago

Thank you @brglng , the redefinition has disappeared.