WinRT: hack-fixed C++/CX compile errors regarding the 'generic' field in SDL_Event, which conflicts with a C++/CX keyword

This commit is contained in:
David Ludwig 2013-04-14 11:45:01 -04:00
parent 41ce3814e2
commit 14337669a2
3 changed files with 19 additions and 0 deletions

View file

@ -148,3 +148,8 @@
#endif
#endif /* NULL */
#endif /* ! Mac OS X - breaks precompiled headers */
/* HACK: Make sure C++/CX works when compiling WinRT code */
#if defined(__WINRT__)
#define generic generic_
#endif

View file

@ -35,3 +35,8 @@
#endif
#pragma pack(pop)
#endif /* Compiler needs structure packing set */
/* Revert hack used to get C++/CX (WinRT) code compiling. */
#if defined(__WINRT__)
#undef generic
#endif

View file

@ -33,6 +33,15 @@
#endif
#include "../video/SDL_sysvideo.h"
/* HACK: Make sure the 'generic' field in SDL_Event works on
WinRT, whereby 'generic' is redefined as 'generic_', in order to
allow SDL.h to be included in code compiled with Microsoft's
C++/CX extension.
*/
#if defined(__WINRT__)
#define generic generic_
#endif
/* Public data -- the event filter */
SDL_EventFilter SDL_EventOK = NULL;
void *SDL_EventOKParam;