SDL_stdinc.h: move the alloca() includes before begin_code.h
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 10 May 2018 08:28:00 +0300
changeset 11961a9203ed58516
parent 11960 9f61cd1be333
child 11980 5e1341f8c467
SDL_stdinc.h: move the alloca() includes before begin_code.h
include/SDL_stdinc.h
     1.1 --- a/include/SDL_stdinc.h	Thu May 10 08:25:23 2018 +0300
     1.2 +++ b/include/SDL_stdinc.h	Thu May 10 08:28:00 2018 +0300
     1.3 @@ -86,6 +86,28 @@
     1.4  #ifdef HAVE_FLOAT_H
     1.5  # include <float.h>
     1.6  #endif
     1.7 +#if defined(HAVE_ALLOCA) && !defined(alloca)
     1.8 +# if defined(HAVE_ALLOCA_H)
     1.9 +#  include <alloca.h>
    1.10 +# elif defined(__GNUC__)
    1.11 +#  define alloca __builtin_alloca
    1.12 +# elif defined(_MSC_VER)
    1.13 +#  include <malloc.h>
    1.14 +#  define alloca _alloca
    1.15 +# elif defined(__WATCOMC__)
    1.16 +#  include <malloc.h>
    1.17 +# elif defined(__BORLANDC__)
    1.18 +#  include <malloc.h>
    1.19 +# elif defined(__DMC__)
    1.20 +#  include <stdlib.h>
    1.21 +# elif defined(__AIX__)
    1.22 +#pragma alloca
    1.23 +# elif defined(__MRC__)
    1.24 +void *alloca(unsigned);
    1.25 +# else
    1.26 +char *alloca();
    1.27 +# endif
    1.28 +#endif
    1.29  
    1.30  /**
    1.31   *  The number of elements in an array.
    1.32 @@ -328,28 +350,6 @@
    1.33  extern "C" {
    1.34  #endif
    1.35  
    1.36 -#if defined(HAVE_ALLOCA) && !defined(alloca)
    1.37 -# if defined(HAVE_ALLOCA_H)
    1.38 -#  include <alloca.h>
    1.39 -# elif defined(__GNUC__)
    1.40 -#  define alloca __builtin_alloca
    1.41 -# elif defined(_MSC_VER)
    1.42 -#  include <malloc.h>
    1.43 -#  define alloca _alloca
    1.44 -# elif defined(__WATCOMC__)
    1.45 -#  include <malloc.h>
    1.46 -# elif defined(__BORLANDC__)
    1.47 -#  include <malloc.h>
    1.48 -# elif defined(__DMC__)
    1.49 -#  include <stdlib.h>
    1.50 -# elif defined(__AIX__)
    1.51 -#pragma alloca
    1.52 -# elif defined(__MRC__)
    1.53 -void *alloca(unsigned);
    1.54 -# else
    1.55 -char *alloca();
    1.56 -# endif
    1.57 -#endif
    1.58  #ifdef HAVE_ALLOCA
    1.59  #define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
    1.60  #define SDL_stack_free(data)
    1.61 @@ -445,7 +445,6 @@
    1.62  #endif
    1.63  }
    1.64  
    1.65 -
    1.66  extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
    1.67  
    1.68  extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);