yvanvds / yse-soundengine

advanced 3D sound engine
Eclipse Public License 1.0
234 stars 33 forks source link

Naming conflict with visual studio macros #6

Closed spartanPAGE closed 8 years ago

spartanPAGE commented 8 years ago

https://github.com/yvanvds/yse-soundengine/blob/master/yse/sound/sound.hpp#L36 -> SOUND::MESSAGE:: RELATIVE (wingdi.h) https://github.com/yvanvds/yse-soundengine/blob/master/yse/synth/synth.hpp#L37 -> SYNTH::MESSAGE:: CALLBACK (minwindef.h)

Works fine when renamed (looks like nothing depend on these names);

yvanvds commented 8 years ago

I don't completely understand the issue here. What visual studio macro's are you refering to? I did build YSE with visual studio and had no problems there.

If you are using the YSE binary release they can be changed indeed, because they're just enums. It is the value that is passed around in the library, not the name.

spartanPAGE commented 8 years ago

@yvanvds Sorry, i had winapi on my mind, not visual studio.

yvanvds commented 8 years ago

Ok, i see now. Those files (especially wingdi.h) contain a lot of defines. And that's problem with defines: they're not in a namespace. Whatever name I pick, there will always be some header file out there that uses the same name.

Perhaps you could try including wingdi.h first, followed by:

undef RELATIVE

After that, include yse.hpp