From 003cfc63c69b3e900de768317354dfb80bbf6a55 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 3 Jan 2015 02:22:14 +0200 Subject: mingw build fixes --- plugins/cdrcimg/cdrcimg.c | 10 +++++++++- plugins/dfinput/main.c | 15 +++++++++++---- plugins/dfsound/spu.c | 13 +++---------- plugins/dfsound/stdafx.h | 20 +++++++------------- plugins/dfsound/xa.c | 4 ++++ 5 files changed, 34 insertions(+), 28 deletions(-) (limited to 'plugins') diff --git a/plugins/cdrcimg/cdrcimg.c b/plugins/cdrcimg/cdrcimg.c index 0ec14db..76cdfba 100644 --- a/plugins/cdrcimg/cdrcimg.c +++ b/plugins/cdrcimg/cdrcimg.c @@ -12,7 +12,13 @@ #include #include #include +#ifndef _WIN32 +#define CALLBACK #include +#else +#define WIN32_LEAN_AND_MEAN +#include +#endif #include "cdrcimg.h" @@ -44,7 +50,7 @@ static struct { static int current_block, current_sect_in_blk; struct CdrStat; -extern long CDR__getStatus(struct CdrStat *stat); +extern long CALLBACK CDR__getStatus(struct CdrStat *stat); struct CdrStat { @@ -279,6 +285,7 @@ static long CDRinit(void) return -1; } } +#ifndef _WIN32 if (pBZ2_bzBuffToBuffDecompress == NULL) { void *h = dlopen("/usr/lib/libbz2.so.1", RTLD_LAZY); if (h == NULL) @@ -291,6 +298,7 @@ static long CDRinit(void) } } } +#endif return 0; } diff --git a/plugins/dfinput/main.c b/plugins/dfinput/main.c index 73b2bda..475ea07 100644 --- a/plugins/dfinput/main.c +++ b/plugins/dfinput/main.c @@ -8,6 +8,13 @@ * See the COPYING file in the top-level directory. */ +#ifndef _WIN32 +#define CALLBACK +#else +#define WIN32_LEAN_AND_MEAN +#include +#endif + #include "main.h" unsigned char CurPad, CurByte, CurCmd, CmdLen; @@ -15,10 +22,10 @@ unsigned char CurPad, CurByte, CurCmd, CmdLen; /* since this is not a proper plugin, so we'll hook emu internals in a hackish way like this */ extern void *PAD1_startPoll, *PAD1_poll; extern void *PAD2_startPoll, *PAD2_poll; -extern unsigned char PAD1__startPoll(int pad); -extern unsigned char PAD2__startPoll(int pad); -extern unsigned char PAD1__poll(unsigned char value); -extern unsigned char PAD2__poll(unsigned char value); +extern unsigned char CALLBACK PAD1__startPoll(int pad); +extern unsigned char CALLBACK PAD2__startPoll(int pad); +extern unsigned char CALLBACK PAD1__poll(unsigned char value); +extern unsigned char CALLBACK PAD2__poll(unsigned char value); static int old_controller_type1 = -1, old_controller_type2 = -1; diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 835555d..d39bbc1 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -18,6 +18,9 @@ * * ***************************************************************************/ +#ifndef _WIN32 +#include // gettimeofday in xa.c +#endif #include "stdafx.h" #define _IN_SPU @@ -28,16 +31,6 @@ #include "arm_features.h" #include "spu_config.h" -#ifdef ENABLE_NLS -#include -#include -#define _(x) gettext(x) -#define N_(x) (x) -#else -#define _(x) (x) -#define N_(x) (x) -#endif - #ifdef __ARM_ARCH_7A__ #define ssat32_to_16(v) \ asm("ssat %0,#16,%1" : "=r" (v) : "r" (v)) diff --git a/plugins/dfsound/stdafx.h b/plugins/dfsound/stdafx.h index 8993bb3..7e22029 100644 --- a/plugins/dfsound/stdafx.h +++ b/plugins/dfsound/stdafx.h @@ -15,26 +15,20 @@ * * ***************************************************************************/ -#ifndef _MACOSX -#include "config.h" -#endif #include #include -#include -#include -#include -#include -#include -#define RRand(range) (random()%range) #include -#include -#include +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#else #undef CALLBACK #define CALLBACK #define DWORD unsigned int -#define LOWORD(l) ((unsigned short)(l)) -#define HIWORD(l) ((unsigned short)(((unsigned int)(l) >> 16) & 0xFFFF)) +#define LOWORD(l) ((unsigned short)(l)) +#define HIWORD(l) ((unsigned short)(((unsigned int)(l) >> 16) & 0xFFFF)) +#endif #ifndef INLINE #define INLINE static inline diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c index 704847b..9b7ed5a 100644 --- a/plugins/dfsound/xa.c +++ b/plugins/dfsound/xa.c @@ -90,9 +90,13 @@ INLINE void MixXA(int ns_to) static unsigned long timeGetTime_spu() { +#ifdef _WIN32 + return GetTickCount(); +#else struct timeval tv; gettimeofday(&tv, 0); // well, maybe there are better ways return tv.tv_sec * 1000 + tv.tv_usec/1000; // to do that, but at least it works +#endif } //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3