applied fix for SDL bug #4159

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1582 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2018-05-11 20:32:57 +00:00
parent a40d20da2c
commit 12f743d407
8 changed files with 174 additions and 164 deletions

View file

@ -73,6 +73,28 @@
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
# include <iconv.h>
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
/** The number of elements in an array */
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
@ -182,28 +204,6 @@ extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
extern DECLSPEC void SDLCALL SDL_free(void *mem);
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)

View file

@ -31,6 +31,29 @@
#include "SDL_error.h"
#include "SDL_version.h"
#ifndef SDL_PROTOTYPES_ONLY
# if defined(SDL_VIDEO_DRIVER_X11)
# if defined(__APPLE__) && defined(__MACH__)
# define Cursor X11Cursor /* conflicts with Quickdraw.h */
# endif
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# if defined(__APPLE__) && defined(__MACH__)
# undef Cursor
# endif
# elif defined(SDL_VIDEO_DRIVER_NANOX)
# include <microwin/nano-X.h>
# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# elif defined(SDL_VIDEO_DRIVER_PHOTON)
# include <sys/neutrino.h>
# include <Ph.h>
# endif
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@ -43,25 +66,13 @@ extern "C" {
* an unhandled window event occurs. This event is ignored by default, but
* you can enable it with SDL_EventState()
*/
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else
#ifndef SDL_PROTOTYPES_ONLY
/* This is the structure for custom window manager events */
#if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */
#define Cursor X11Cursor
#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__)
/* matches the re-define above */
#undef Cursor
#endif
/** These are the various supported subsystems under UNIX */
typedef enum {
@ -81,7 +92,7 @@ struct SDL_SysWMmsg {
* When this structure is returned, it holds information about which
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
@ -111,10 +122,9 @@ typedef struct SDL_SysWMinfo {
/*@}*/
} x11;
} info;
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_NANOX)
#include <microwin/nano-X.h>
/** The generic custom event structure */
struct SDL_SysWMmsg {
@ -123,14 +133,12 @@ struct SDL_SysWMmsg {
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/** The windows custom event structure */
struct SDL_SysWMmsg {
@ -142,11 +150,11 @@ struct SDL_SysWMmsg {
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
HWND window; /**< The Win32 display window */
HGLRC hglrc; /**< The OpenGL context, if any */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
@ -158,16 +166,14 @@ struct SDL_SysWMmsg {
};
/** The RISC OS custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int wimpVersion; /**< Wimp version running under */
int taskHandle; /**< The RISC OS task handle */
int window; /**< The RISC OS display window */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
#include <sys/neutrino.h>
#include <Ph.h>
/** The QNX custom event structure */
struct SDL_SysWMmsg {
@ -176,10 +182,10 @@ struct SDL_SysWMmsg {
};
/** The QNX custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
};
#else
@ -190,10 +196,10 @@ struct SDL_SysWMmsg {
};
/** The generic custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
};
#endif /* video driver type */

View file

@ -86,6 +86,28 @@
#ifdef HAVE_FLOAT_H
# include <float.h>
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca(unsigned);
# else
char *alloca();
# endif
#endif
/**
* The number of elements in an array.
@ -328,28 +350,6 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
extern "C" {
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca(unsigned);
# else
char *alloca();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)
@ -445,7 +445,6 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
#endif
}
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);

View file

@ -33,12 +33,6 @@
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \file SDL_syswm.h
*
@ -115,6 +109,12 @@ typedef void *EGLSurface;
#include <os2.h>
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* These are the various supported windowing subsystems
*/

View file

@ -73,6 +73,28 @@
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
# include <iconv.h>
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
/** The number of elements in an array */
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
@ -182,28 +204,6 @@ extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
extern DECLSPEC void SDLCALL SDL_free(void *mem);
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)

View file

@ -31,6 +31,29 @@
#include "SDL_error.h"
#include "SDL_version.h"
#ifndef SDL_PROTOTYPES_ONLY
# if defined(SDL_VIDEO_DRIVER_X11)
# if defined(__APPLE__) && defined(__MACH__)
# define Cursor X11Cursor /* conflicts with Quickdraw.h */
# endif
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# if defined(__APPLE__) && defined(__MACH__)
# undef Cursor
# endif
# elif defined(SDL_VIDEO_DRIVER_NANOX)
# include <microwin/nano-X.h>
# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# elif defined(SDL_VIDEO_DRIVER_PHOTON)
# include <sys/neutrino.h>
# include <Ph.h>
# endif
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@ -43,25 +66,13 @@ extern "C" {
* an unhandled window event occurs. This event is ignored by default, but
* you can enable it with SDL_EventState()
*/
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else
#ifndef SDL_PROTOTYPES_ONLY
/* This is the structure for custom window manager events */
#if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */
#define Cursor X11Cursor
#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__)
/* matches the re-define above */
#undef Cursor
#endif
/** These are the various supported subsystems under UNIX */
typedef enum {
@ -81,7 +92,7 @@ struct SDL_SysWMmsg {
* When this structure is returned, it holds information about which
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
@ -111,10 +122,9 @@ typedef struct SDL_SysWMinfo {
/*@}*/
} x11;
} info;
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_NANOX)
#include <microwin/nano-X.h>
/** The generic custom event structure */
struct SDL_SysWMmsg {
@ -123,14 +133,12 @@ struct SDL_SysWMmsg {
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/** The windows custom event structure */
struct SDL_SysWMmsg {
@ -142,11 +150,11 @@ struct SDL_SysWMmsg {
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
HWND window; /**< The Win32 display window */
HGLRC hglrc; /**< The OpenGL context, if any */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
@ -158,16 +166,14 @@ struct SDL_SysWMmsg {
};
/** The RISC OS custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int wimpVersion; /**< Wimp version running under */
int taskHandle; /**< The RISC OS task handle */
int window; /**< The RISC OS display window */
} SDL_SysWMinfo;
};
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
#include <sys/neutrino.h>
#include <Ph.h>
/** The QNX custom event structure */
struct SDL_SysWMmsg {
@ -176,10 +182,10 @@ struct SDL_SysWMmsg {
};
/** The QNX custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
};
#else
@ -190,10 +196,10 @@ struct SDL_SysWMmsg {
};
/** The generic custom window manager information structure */
typedef struct SDL_SysWMinfo {
struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
};
#endif /* video driver type */

View file

@ -86,6 +86,28 @@
#ifdef HAVE_FLOAT_H
# include <float.h>
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca(unsigned);
# else
char *alloca();
# endif
#endif
/**
* The number of elements in an array.
@ -328,28 +350,6 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
extern "C" {
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca(unsigned);
# else
char *alloca();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)
@ -445,7 +445,6 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
#endif
}
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);

View file

@ -33,12 +33,6 @@
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \file SDL_syswm.h
*
@ -115,6 +109,12 @@ typedef void *EGLSurface;
#include <os2.h>
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* These are the various supported windowing subsystems
*/