stb_image_write: tweak handling of STB_IMAGE_WRITE_STATIC

master
Sean Barrett 2018-02-11 11:29:32 -08:00
parent aeb2b4b64d
commit 543ad0c112
1 changed files with 11 additions and 19 deletions

View File

@ -148,25 +148,23 @@ LICENSE
#ifndef INCLUDE_STB_IMAGE_WRITE_H #ifndef INCLUDE_STB_IMAGE_WRITE_H
#define INCLUDE_STB_IMAGE_WRITE_H #define INCLUDE_STB_IMAGE_WRITE_H
#ifndef STB_IMAGE_WRITE_STATIC // if STB_IMAGE_WRITE_STATIC causes problems, try defining STBIWDEF to 'inline' or 'static inline'
#ifdef __cplusplus
extern "C" {
#endif
#endif
#ifndef STBIWDEF #ifndef STBIWDEF
#ifdef STB_IMAGE_WRITE_STATIC #ifdef STB_IMAGE_WRITE_STATIC
#define STBIWDEF static #define STBIWDEF static
#else #else
#define STBIWDEF extern #ifdef __cplusplus
#define STBIWDEF extern "C"
#else
#define STBIWDEF extern
#endif
#endif #endif
#endif #endif
#ifndef STB_IMAGE_WRITE_STATIC #ifndef STB_IMAGE_WRITE_STATIC // C++ forbids static forward declarations
// C++ forbids static forward declarations extern int stbi_write_tga_with_rle;
STBIWDEF int stbi_write_tga_with_rle; extern int stbi_write_png_compression_level;
STBIWDEF int stbi_write_png_compression_level; extern int stbi_write_force_png_filter;
STBIWDEF int stbi_write_force_png_filter;
#endif #endif
#ifndef STBI_WRITE_NO_STDIO #ifndef STBI_WRITE_NO_STDIO
@ -187,12 +185,6 @@ STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x,
STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean); STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
#ifndef STB_IMAGE_WRITE_STATIC
#ifdef __cplusplus
}
#endif
#endif
#endif//INCLUDE_STB_IMAGE_WRITE_H #endif//INCLUDE_STB_IMAGE_WRITE_H
#ifdef STB_IMAGE_WRITE_IMPLEMENTATION #ifdef STB_IMAGE_WRITE_IMPLEMENTATION