Skip to content

Commit

Permalink
Removed some dependencies on C runtime for building on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 22, 2017
1 parent 357c5f2 commit ec1ab7d
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 54 deletions.
4 changes: 0 additions & 4 deletions IMG.c 100644 → 100755
Expand Up @@ -21,10 +21,6 @@

/* A simple library to load images of various formats as SDL surfaces */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "SDL_image.h"

#define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
Expand Down
3 changes: 0 additions & 3 deletions IMG_bmp.c 100644 → 100755
Expand Up @@ -30,9 +30,6 @@
* http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html
*/

#include <stdio.h>
#include <string.h>

#include "SDL_image.h"

#ifdef LOAD_BMP
Expand Down
3 changes: 0 additions & 3 deletions IMG_gif.c 100644 → 100755
Expand Up @@ -23,9 +23,6 @@

/* This is a GIF image file loading framework */

#include <stdio.h>
#include <string.h>

#include "SDL_image.h"

#ifdef LOAD_GIF
Expand Down
1 change: 0 additions & 1 deletion IMG_jpg.c 100644 → 100755
Expand Up @@ -22,7 +22,6 @@
/* This is a JPEG image file loading framework */

#include <stdio.h>
#include <string.h>
#include <setjmp.h>

#include "SDL_image.h"
Expand Down
4 changes: 0 additions & 4 deletions IMG_lbm.c 100644 → 100755
Expand Up @@ -30,10 +30,6 @@
Buffer overflow fix in RLE decompression by David Raulo in January 2008.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "SDL_endian.h"
#include "SDL_image.h"

Expand Down
2 changes: 0 additions & 2 deletions IMG_pcx.c 100644 → 100755
Expand Up @@ -32,8 +32,6 @@
* single-planar packed-pixel formats other than 8bpp
* 4-plane 32bpp format with a fourth "intensity" plane
*/
#include <stdio.h>
#include <stdlib.h>

#include "SDL_endian.h"

Expand Down
5 changes: 0 additions & 5 deletions IMG_pnm.c 100644 → 100755
Expand Up @@ -27,11 +27,6 @@
* Does not support: maximum component value > 255
*/

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

#include "SDL_image.h"

#ifdef LOAD_PNM
Expand Down
9 changes: 4 additions & 5 deletions IMG_svg.c
Expand Up @@ -27,13 +27,12 @@

#ifdef LOAD_SVG

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>

/* Replace C runtime functions with SDL C runtime functions for building on Windows */
#define strtoll SDL_strtoll
#define sscanf SDL_sscanf
#ifndef FLT_MAX
#define FLT_MAX 3.402823466e+38F
#endif

#define NANOSVG_IMPLEMENTATION
#include "nanosvg.h"
Expand Down
4 changes: 0 additions & 4 deletions IMG_tga.c 100644 → 100755
Expand Up @@ -23,10 +23,6 @@

/* This is a Targa image file loading framework */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "SDL_endian.h"

#include "SDL_image.h"
Expand Down
4 changes: 0 additions & 4 deletions IMG_tif.c 100644 → 100755
Expand Up @@ -23,8 +23,6 @@

/* This is a TIFF image file loading framework */

#include <stdio.h>

#include "SDL_image.h"

#ifdef LOAD_TIF
Expand Down Expand Up @@ -208,8 +206,6 @@ SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src)
SDL_Surface* surface = NULL;
Uint32 img_width, img_height;
Uint32 Rmask, Gmask, Bmask, Amask;
Uint32 x, y;
Uint32 half;

if ( !src ) {
/* The error message has been set in SDL_RWFromFile */
Expand Down
5 changes: 1 addition & 4 deletions IMG_webp.c 100644 → 100755
Expand Up @@ -21,9 +21,6 @@

/* This is a WEBP image file loading framework */

#include <stdlib.h>
#include <stdio.h>

#include "SDL_image.h"

#ifdef LOAD_WEBP
Expand Down Expand Up @@ -160,7 +157,7 @@ static int webp_getinfo( SDL_RWops *src, int *datasize ) {
#endif
is_WEBP = 1;
if ( datasize ) {
*datasize = (int)SDL_RWseek(src, 0, SEEK_END);
*datasize = (int)SDL_RWseek(src, 0, RW_SEEK_END);
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions IMG_xcf.c 100644 → 100755
Expand Up @@ -21,11 +21,6 @@

/* This is a XCF image file loading framework */

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>

#include "SDL_endian.h"
#include "SDL_image.h"

Expand Down
5 changes: 0 additions & 5 deletions IMG_xpm.c 100644 → 100755
Expand Up @@ -42,11 +42,6 @@
* requires about 13K in binary form.
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "SDL_image.h"

#ifdef LOAD_XPM
Expand Down
3 changes: 0 additions & 3 deletions IMG_xv.c 100644 → 100755
Expand Up @@ -21,9 +21,6 @@

/* This is a XV thumbnail image file loading framework */

#include <stdio.h>
#include <string.h>

#include "SDL_image.h"

#ifdef LOAD_XV
Expand Down
2 changes: 0 additions & 2 deletions IMG_xxx.c 100644 → 100755
Expand Up @@ -21,8 +21,6 @@

/* This is a generic "format not supported" image framework */

#include <stdio.h>

#include "SDL_image.h"

#ifdef LOAD_XXX
Expand Down
2 changes: 2 additions & 0 deletions nanosvg.h
Expand Up @@ -2981,6 +2981,7 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
return ret;
}

#ifdef HAVE_STDIO_H
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
{
FILE* fp = NULL;
Expand Down Expand Up @@ -3009,6 +3010,7 @@ NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
if (image) nsvgDelete(image);
return NULL;
}
#endif /* HAVE_STDIO_H */

void nsvgDelete(NSVGimage* image)
{
Expand Down

0 comments on commit ec1ab7d

Please sign in to comment.