Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h
authorSam Lantinga <slouken@libsdl.org>
Fri, 07 Oct 2016 16:44:42 -0700
changeset 1048142a679ff48e0
parent 10480 145a5c94ede3
child 10482 f99f58ef8363
Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h

Ryan C. Gordon

We still include iconv.h in SDL_stdinc.h, probably because this header might have referenced the native iconv functions and types directly. Since these are hidden behind a stable ABI now and never just a #define for the system iconv, we shouldn't need this header included from a public SDL header anymore, slowing down external apps compiles and pulling tons of stuff into the namespace.
include/SDL_stdinc.h
src/stdlib/SDL_iconv.c
     1.1 --- a/include/SDL_stdinc.h	Fri Oct 07 19:39:43 2016 -0400
     1.2 +++ b/include/SDL_stdinc.h	Fri Oct 07 16:44:42 2016 -0700
     1.3 @@ -83,9 +83,6 @@
     1.4  #ifdef HAVE_FLOAT_H
     1.5  # include <float.h>
     1.6  #endif
     1.7 -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
     1.8 -# include <iconv.h>
     1.9 -#endif
    1.10  
    1.11  /**
    1.12   *  The number of elements in an array.
     2.1 --- a/src/stdlib/SDL_iconv.c	Fri Oct 07 19:39:43 2016 -0400
     2.2 +++ b/src/stdlib/SDL_iconv.c	Fri Oct 07 16:44:42 2016 -0700
     2.3 @@ -31,6 +31,7 @@
     2.4  #include "SDL_endian.h"
     2.5  
     2.6  #ifdef HAVE_ICONV
     2.7 +#include <iconv.h>
     2.8  
     2.9  /* Depending on which standard the iconv() was implemented with,
    2.10     iconv() may or may not use const char ** for the inbuf param.