mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
properly target windows 2000 in mingw build + allows to build for windows ME now as well
This commit is contained in:
parent
7175939854
commit
beae3c5fb7
23
Makefile
23
Makefile
@ -1,15 +1,16 @@
|
||||
-include config.mk
|
||||
|
||||
TARGET = ddraw.dll
|
||||
LDFLAGS = -Wl,--enable-stdcall-fixup -s -static -shared
|
||||
CFLAGS = -Iinc -O2 -march=i486 -Wall -std=c99
|
||||
LIBS = -lgdi32 -lwinmm -ldbghelp -lole32
|
||||
TARGET ?= ddraw.dll
|
||||
|
||||
LDFLAGS ?= -Wl,--enable-stdcall-fixup -s -static -shared
|
||||
CFLAGS ?= -Iinc -O2 -Wall -std=c99
|
||||
LIBS = -lgdi32 -lwinmm -ldbghelp -lole32 -lMsimg32
|
||||
|
||||
COMMIT := $(shell git describe --match=NeVeRmAtCh --always --dirty || echo UNKNOWN)
|
||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo UNKNOWN)
|
||||
|
||||
CMDTEST := $(shell echo \"\")
|
||||
ifeq ($(CMDTEST),\"\")
|
||||
ECHOTEST := $(shell echo \"\")
|
||||
ifeq ($(ECHOTEST),\"\")
|
||||
# Windows
|
||||
HASH := \#
|
||||
ECOMMIT := $(shell echo $(HASH)define GIT_COMMIT "$(COMMIT)" > inc/git.h)
|
||||
@ -20,13 +21,17 @@ else
|
||||
EBRANCH := $(shell echo "#define GIT_BRANCH" \"$(BRANCH)\" >> inc/git.h)
|
||||
endif
|
||||
|
||||
CC = i686-w64-mingw32-gcc
|
||||
WINDRES ?= i686-w64-mingw32-windres
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -D _DEBUG -D _DEBUG_X
|
||||
endif
|
||||
|
||||
ifdef _WIN32_WINNT
|
||||
CFLAGS += -march=i486 -D _WIN32_WINNT=$(_WIN32_WINNT)
|
||||
endif
|
||||
|
||||
CC = i686-w64-mingw32-gcc
|
||||
WINDRES ?= i686-w64-mingw32-windres
|
||||
|
||||
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c) res.rc
|
||||
OBJS := $(addsuffix .o, $(basename $(SRCS)))
|
||||
|
||||
|
@ -10,6 +10,6 @@ set GIT6=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\
|
||||
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
||||
|
||||
make clean
|
||||
make
|
||||
make _WIN32_WINNT=0x0500
|
||||
|
||||
pause
|
||||
|
@ -10,6 +10,6 @@ set GIT6=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\
|
||||
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
||||
|
||||
make clean
|
||||
make DEBUG=1
|
||||
make DEBUG=1 _WIN32_WINNT=0x0500
|
||||
|
||||
pause
|
||||
|
12
inc/dd.h
12
inc/dd.h
@ -64,6 +64,18 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
||||
#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
|
||||
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
|
||||
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
|
||||
#endif
|
||||
|
||||
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||
#define GdiTransparentBlt TransparentBlt
|
||||
#endif
|
||||
|
||||
typedef struct SPEEDLIMITER
|
||||
{
|
||||
DWORD tick_length;
|
||||
|
@ -28,6 +28,11 @@
|
||||
#define _WIN32_WINNT_WIN11 0x0A00
|
||||
#endif
|
||||
|
||||
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||
#define RtlVerifyVersionInfo(a,b,c) 1
|
||||
#define VerifyVersionInfoW(a,b,c) 0
|
||||
#define VerSetConditionMask(a,b,c) 0
|
||||
#endif
|
||||
|
||||
void verhelp_init();
|
||||
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask);
|
||||
|
@ -73,7 +73,7 @@ LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception)
|
||||
HMODULE mod = NULL;
|
||||
char filename[MAX_PATH] = { 0 };
|
||||
|
||||
#if defined(_MSC_VER) /* comment this out just to keep the mingw build win2000 compatible */
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
|
||||
if (GetModuleHandleExA(
|
||||
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
exception->ExceptionRecord->ExceptionAddress,
|
||||
|
Loading…
x
Reference in New Issue
Block a user