changeset 1137:e42aa3c940c1

Add #ifdef guards for stbi__get{16,32}le() for cases where they are not needed (only GIF, TGA and BMP loaders use them.)
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 04 Mar 2015 08:59:33 +0200
parents 2cb0955b50f6
children 2e728c38a386
files src/stb_image.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/stb_image.c	Wed Mar 04 08:52:24 2015 +0200
+++ b/src/stb_image.c	Wed Mar 04 08:59:33 2015 +0200
@@ -1149,17 +1149,21 @@
    return (z << 16) + stbi__get16be(s);
 }
 
+#if !defined(STBI_NO_BMP) && !defined(STBI_NO_TGA) && !defined(STBI_NO_GIF)
 static int stbi__get16le(stbi__context *s)
 {
    int z = stbi__get8(s);
    return z + (stbi__get8(s) << 8);
 }
-
+#endif
+
+#if !defined(STBI_NO_BMP)
 static Uint32 stbi__get32le(stbi__context *s)
 {
    Uint32 z = stbi__get16le(s);
    return z + (stbi__get16le(s) << 16);
 }
+#endif
 
 #define STBI__BYTECAST(x)  ((Uint8) ((x) & 255))  // truncate int to byte without warnings