RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.24k stars 264 forks source link

Add preprocessor guard around CUTE_TILED_SNPRINTF #294

Closed mupfdev closed 2 years ago

mupfdev commented 2 years ago

Some platforms do not provide that function. This way, the use of snprintf can be explicitly deactivated:

#define CUTE_TILED_SNPRINTF(ARGS...) (void)(ARGS)
#define CUTE_TILED_IMPLEMENTATION
#include <cute_tiled.h>
mupfdev commented 2 years ago

I wanted to create a separate pull request for the last commit. This obviously did not work. Instead, it was included here.

cute_tiled.h:176: redefinition of `cute_tiled_tileset_t'
cute_tiled.h:113: `cute_tiled_tileset_t' previously declared here

My compiler complained about a redefinition of cute_tiled_tileset_t. That is why I removed line 176. The definition must be known before line 143, that's why I didn't delete it in line 112.

RandyGaul commented 2 years ago

Thank you!