Warning with HAVE_VSNPRINTF

Hello,

So I’m running into an issue where I have two libraries trying to define
HAVE_VSNPRINTF in their header files, with sdl being one of them
(SDL_config.h on 10.4). This is causing some warnings to be raised. It’s
suggested in that file that we can comment out the “HAVE_LIBC”, but I
can’t do that if I’m going to use the system’s version of sdl. Would it
be possible to put a guard in around the HAVE_LIBC to check if it’s
already been defined to 0, and if so, not to define the rest of libc
definitions? This would let me easily work around this problem from my
code. Is there any chance that this can happen? Thanks!

-e

Erick Tryzelaar wrote:

Hello,

So I’m running into an issue where I have two libraries trying to define
HAVE_VSNPRINTF in their header files, with sdl being one of them
(SDL_config.h on 10.4). This is causing some warnings to be raised. It’s
suggested in that file that we can comment out the “HAVE_LIBC”, but I
can’t do that if I’m going to use the system’s version of sdl. Would it
be possible to put a guard in around the HAVE_LIBC to check if it’s
already been defined to 0, and if so, not to define the rest of libc
definitions? This would let me easily work around this problem from my
code. Is there any chance that this can happen? Thanks!

Now that I think about it, I’m running into this because I’m including
SDL_opengl.h, which includes SDL_config.h. But looking at the
documentation, it looks like all opengl needs is the various flags
defined in SDL_config, not any of the libc defines. I know it’d break
backwards compatibility if we moved the libc stuff into another file,
but could this be considered in, say, 1.3?

-e

Erick Tryzelaar wrote:

Hello,

So I’m running into an issue where I have two libraries trying to define
HAVE_VSNPRINTF in their header files, with sdl being one of them
(SDL_config.h on 10.4). This is causing some warnings to be raised. It’s
suggested in that file that we can comment out the “HAVE_LIBC”, but I
can’t do that if I’m going to use the system’s version of sdl. Would it
be possible to put a guard in around the HAVE_LIBC to check if it’s
already been defined to 0, and if so, not to define the rest of libc
definitions? This would let me easily work around this problem from my
code. Is there any chance that this can happen? Thanks!

Would there be any interest in renaming these definitions to put them in
the SDL namespace? For instance, instead of “HAVE_LIBC”, we would have
"SDL_HAVE_LIBC". This would prevent these conflicts. Also, I’d be more
than happy to do the changes and submit a patch once I get it working.

-e