SDL_dynapi.c: add missing SDLCALL to macros.
authorSam Lantinga <slouken@libsdl.org>
Sun, 27 Aug 2017 18:53:30 -0700
changeset 11360b97aaee16bc8
parent 11359 e57ec2346363
child 11361 b83e2eaed190
SDL_dynapi.c: add missing SDLCALL to macros.
src/dynapi/SDL_dynapi.c
     1.1 --- a/src/dynapi/SDL_dynapi.c	Sun Aug 27 18:52:43 2017 -0700
     1.2 +++ b/src/dynapi/SDL_dynapi.c	Sun Aug 27 18:53:30 2017 -0700
     1.3 @@ -62,38 +62,38 @@
     1.4  #if DISABLE_JUMP_MAGIC
     1.5  /* Can't use the macro for varargs nonsense. This is atrocious. */
     1.6  #define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio) \
     1.7 -    _static void SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
     1.8 +    _static void SDLCALL SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
     1.9          va_list ap; initcall; va_start(ap, fmt); \
    1.10          jump_table.SDL_LogMessageV(category, SDL_LOG_PRIORITY_##prio, fmt, ap); \
    1.11          va_end(ap); \
    1.12      }
    1.13  
    1.14  #define SDL_DYNAPI_VARARGS(_static, name, initcall) \
    1.15 -    _static int SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.16 +    _static int SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.17          char buf[512]; /* !!! FIXME: dynamic allocation */ \
    1.18          va_list ap; initcall; va_start(ap, fmt); \
    1.19          jump_table.SDL_vsnprintf(buf, sizeof (buf), fmt, ap); \
    1.20          va_end(ap); \
    1.21          return jump_table.SDL_SetError("%s", buf); \
    1.22      } \
    1.23 -    _static int SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { \
    1.24 +    _static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { \
    1.25          int retval; va_list ap; initcall; va_start(ap, fmt); \
    1.26          retval = jump_table.SDL_vsscanf(buf, fmt, ap); \
    1.27          va_end(ap); \
    1.28          return retval; \
    1.29      } \
    1.30 -    _static int SDL_snprintf##name(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.31 +    _static int SDLCALL SDL_snprintf##name(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.32          int retval; va_list ap; initcall; va_start(ap, fmt); \
    1.33          retval = jump_table.SDL_vsnprintf(buf, maxlen, fmt, ap); \
    1.34          va_end(ap); \
    1.35          return retval; \
    1.36      } \
    1.37 -    _static void SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.38 +    _static void SDLCALL SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.39          va_list ap; initcall; va_start(ap, fmt); \
    1.40          jump_table.SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \
    1.41          va_end(ap); \
    1.42      } \
    1.43 -    _static void SDL_LogMessage##name(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.44 +    _static void SDLCALL SDL_LogMessage##name(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.45          va_list ap; initcall; va_start(ap, fmt); \
    1.46          jump_table.SDL_LogMessageV(category, priority, fmt, ap); \
    1.47          va_end(ap); \
    1.48 @@ -111,9 +111,9 @@
    1.49  /* The DEFAULT funcs will init jump table and then call real function. */
    1.50  /* The REAL funcs are the actual functions, name-mangled to not clash. */
    1.51  #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \
    1.52 -    typedef rc (*SDL_DYNAPIFN_##fn) params; \
    1.53 -    static rc fn##_DEFAULT params; \
    1.54 -    extern rc fn##_REAL params;
    1.55 +    typedef rc (SDLCALL *SDL_DYNAPIFN_##fn) params; \
    1.56 +    static rc SDLCALL fn##_DEFAULT params; \
    1.57 +    extern rc SDLCALL fn##_REAL params;
    1.58  #include "SDL_dynapi_procs.h"
    1.59  #undef SDL_DYNAPI_PROC
    1.60  
    1.61 @@ -125,7 +125,7 @@
    1.62  } SDL_DYNAPI_jump_table;
    1.63  
    1.64  /* Predeclare the default functions for initializing the jump table. */
    1.65 -#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) static rc fn##_DEFAULT params;
    1.66 +#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) static rc SDLCALL fn##_DEFAULT params;
    1.67  #include "SDL_dynapi_procs.h"
    1.68  #undef SDL_DYNAPI_PROC
    1.69  
    1.70 @@ -139,7 +139,7 @@
    1.71  /* Default functions init the function table then call right thing. */
    1.72  #if DISABLE_JUMP_MAGIC
    1.73  #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \
    1.74 -    static rc fn##_DEFAULT params { \
    1.75 +    static rc SDLCALL fn##_DEFAULT params { \
    1.76          SDL_InitDynamicAPI(); \
    1.77          ret jump_table.fn args; \
    1.78      }
    1.79 @@ -156,7 +156,7 @@
    1.80  /* Public API functions to jump into the jump table. */
    1.81  #if DISABLE_JUMP_MAGIC
    1.82  #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \
    1.83 -    rc fn params { ret jump_table.fn args; }
    1.84 +    rc SDLCALL fn params { ret jump_table.fn args; }
    1.85  #define SDL_DYNAPI_PROC_NO_VARARGS 1
    1.86  #include "SDL_dynapi_procs.h"
    1.87  #undef SDL_DYNAPI_PROC