From e665b96d1b38dbf5c01a52d69361e3069eeed56e Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 3 May 2010 08:30:25 +0000 Subject: [PATCH] MinGW build fix git-svn-id: https://svn.eduke32.com/eduke32@1627 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 21 +++++++++++---------- polymer/eduke32/build/Makefile | 7 ++++++- polymer/eduke32/build/include/rawinput.h | 8 ++++++++ polymer/eduke32/build/src/rawinput.c | 5 +++++ 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 3d1bb52fe..07a67d65b 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -92,23 +92,24 @@ OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ -fjump-tables -fno-stack-protector # -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse OURCXXFLAGS=-fno-exceptions -fno-rtti -LIBS=-lm -ldl -pthread +LIBS=-lm NASMFLAGS = -s EXESUFFIX= include $(EROOT)/Makefile.shared - ifeq ($(PLATFORM),WINDOWS) - OBJ=obj_win - EOBJ=eobj_win - else - ifeq (1,$(PROFILER)) - LIBS+= -lprofiler - endif - OBJ=obj - EOBJ=eobj +ifeq ($(PLATFORM),WINDOWS) + OBJ=obj_win + EOBJ=eobj_win +else + LIBS+= -ldl -pthread + ifeq (1,$(PROFILER)) + LIBS+= -lprofiler endif + OBJ=obj + EOBJ=eobj +endif JMACTOBJ=$(OBJ)/util_lib.$o \ $(OBJ)/file_lib.$o \ diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index f33a0e9bb..285605356 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -114,7 +114,7 @@ OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ -fjump-tables -fno-stack-protector # -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse OURCXXFLAGS=-fno-exceptions -fno-rtti -LIBS=-pthread -ldl +LIBS= ASFLAGS=-s #-g EXESUFFIX= @@ -125,6 +125,11 @@ ifeq (0,$(NOASM)) ENGINEOBJS+= $(OBJ)/a.$o endif +ifneq ($(PLATFORM),WINDOWS) + LIBS+= -ldl -pthread +endif + + ENGINEOBJS+= \ $(OBJ)/a-c.$o \ $(OBJ)/baselayer.$o \ diff --git a/polymer/eduke32/build/include/rawinput.h b/polymer/eduke32/build/include/rawinput.h index aa25d2dea..683c8d577 100644 --- a/polymer/eduke32/build/include/rawinput.h +++ b/polymer/eduke32/build/include/rawinput.h @@ -11,10 +11,18 @@ int8_t RI_WheelState(); int32_t RI_CaptureInput(int32_t grab, HWND target); +#ifndef VK_LBUTTON #define VK_LBUTTON 0x01 +#endif +#ifndef VK_RBUTTON #define VK_RBUTTON 0x02 +#endif +#ifndef VK_CANCEL #define VK_CANCEL 0x03 +#endif +#ifndef VK_MBUTTON #define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */ +#endif // mouse states for RI_MouseState diff --git a/polymer/eduke32/build/src/rawinput.c b/polymer/eduke32/build/src/rawinput.c index 5c3c62a36..da2ad94c2 100644 --- a/polymer/eduke32/build/src/rawinput.c +++ b/polymer/eduke32/build/src/rawinput.c @@ -14,12 +14,17 @@ static int8_t MWheel = 0; extern volatile uint8_t moustat, mousegrab; extern uint32_t mousewheel[2]; +extern void SetKey(int32_t key, int32_t state); #define MASK_DOWN (1<<(i<<1)) #define MASK_UP (MASK_DOWN<<1) #define MouseWheelFakePressTime 50 +#ifndef GET_RAWINPUT_CODE_WPARAM +#define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff) +#endif + void RI_ProcessMouse(const RAWMOUSE* rmouse) { int32_t i, mask;