Iron out all errors and warnings when compiling with MinGW-w64, targeting either 32-bit or 64-bit.

git-svn-id: https://svn.eduke32.com/eduke32@4078 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-10-07 10:03:11 +00:00
parent 37528be6fd
commit e7c9a0be5d
5 changed files with 22 additions and 7 deletions

View file

@ -37,6 +37,8 @@
// abstractions to the size of a pointer on a given platform // abstractions to the size of a pointer on a given platform
// (ie, they're guaranteed to be the same size as a pointer) // (ie, they're guaranteed to be the same size as a pointer)
#undef __USE_MINGW_ANSI_STDIO // Workaround for MinGW-w64.
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#ifdef HAVE_INTTYPES #ifdef HAVE_INTTYPES

View file

@ -1,18 +1,27 @@
#ifndef __SDL_INC_H #ifndef __SDL_INC_H
#define __SDL_INC_H #define __SDL_INC_H
// Workaround for i686-MinGW-w64.
#if defined __MINGW64_VERSION_MAJOR && !defined __MINGW64__
# define __MINGW64_VERSION_MAJOR_BACKUP __MINGW64_VERSION_MAJOR
# undef __MINGW64_VERSION_MAJOR
#endif
#if defined(SDL_FRAMEWORK) #if defined(SDL_FRAMEWORK)
# if (SDL_TARGET == 2) # if (SDL_TARGET == 2)
# include <SDL2/SDL.h> # include <SDL2/SDL.h>
# include <SDL2/SDL_thread.h>
# else # else
# include <SDL/SDL.h> # include <SDL/SDL.h>
# include <SDL/SDL_thread.h>
# endif # endif
#else #else
# include "SDL.h" # include "SDL.h"
#endif #endif
#if defined __MINGW64_VERSION_MAJOR_BACKUP && !defined __MINGW64__
# define __MINGW64_VERSION_MAJOR __MINGW64_VERSION_MAJOR_BACKUP
# undef __MINGW64_VERSION_MAJOR_BACKUP
#endif
/* ================================================================= /* =================================================================
Minimum required SDL versions: Minimum required SDL versions:
=================================================================== */ =================================================================== */

View file

@ -0,0 +1,5 @@
struct sdlappicon {
int32_t width,height;
uint8_t *pixels;
};

View file

@ -13,10 +13,7 @@
HINSTANCE win_gethinstance(void); HINSTANCE win_gethinstance(void);
#endif #endif
struct sdlappicon { #include "sdlappicon.h"
int32_t width,height;
uint8_t *pixels;
};
#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2 #if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2
int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout); int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout);

View file

@ -1,4 +1,6 @@
#include "sdlayer.h"
#include "compat.h"
#include "sdlappicon.h"
static uint8_t sdlappicon_pixels[] = { static uint8_t sdlappicon_pixels[] = {
#if defined _WIN32 && SDL_MAJOR_VERSION==1 #if defined _WIN32 && SDL_MAJOR_VERSION==1