Skip to content

Commit d181aa6

Browse files
committed
stbi: make static
not to spoil the global namespace + since some functions are not used, it may also save a few bytes in build
1 parent 53d7161 commit d181aa6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/utils/image_delegate.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@
4646
#define strtok_s strtok_r
4747
#endif
4848

49+
#ifdef __GNUC__
50+
#pragma GCC diagnostic push
51+
#pragma GCC diagnostic ignored "-Wunused-function"
52+
#endif
53+
4954
#include "../gpujpeg_common_internal.h"
5055
#include "../../libgpujpeg/gpujpeg_decoder.h" // ddecoder placeholders
5156
#include "image_delegate.h"
5257
#include "pam.h"
5358
#define STB_IMAGE_WRITE_IMPLEMENTATION
59+
#define STB_IMAGE_WRITE_STATIC
5460
#include "stb_image_write.h"
5561
#include "y4m.h"
5662

@@ -68,8 +74,13 @@ gpujpeg_cuda_realloc_sized_host(void* ptr, int oldsz, int newsz);
6874
#define STBI_FREE gpujpeg_cuda_free_host
6975
#define STBI_REALLOC_SIZED gpujpeg_cuda_realloc_sized_host
7076
#define STB_IMAGE_IMPLEMENTATION
77+
#define STB_IMAGE_STATIC
7178
#include "stb_image.h"
7279

80+
#ifdef __GNUC__
81+
#pragma GCC diagnostic pop
82+
#endif
83+
7384
enum {
7485
DEPTH_8B = 8,
7586
MAXVAL_8B = 255,

0 commit comments

Comments
 (0)