Refactor PR #156

This commit is contained in:
Colton Rushton 2020-05-19 10:32:01 -03:00
parent 3a204f25c2
commit 9230cb832d
2 changed files with 29 additions and 8 deletions

View file

@ -35,18 +35,33 @@ NODRAWINGDISTANCE ?= 0
TEXTURE_FIX ?= 0
# Enable extended options menu by default
EXT_OPTIONS_MENU ?= 1
# Disable no bzero/bcopy workaround by default
# Enable by default for MXE builds
ifeq ($(WINDOWS_BUILD),1)
ifeq ($(CROSS),i686-w64-mingw32.static-)
NO_BZERO_BCOPY := 1
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
NO_BZERO_BCOPY := 1
else
NO_BZERO_BCOPY ?= 0
endif
else
NO_BZERO_BCOPY ?= 0
endif
# Build for Emscripten/WebGL
TARGET_WEB ?= 0
# Specify the target you are building for, 0 means native
TARGET_ARCH ?= native
ifeq ($(CROSS),i686-w64-mingw32.static-)
TARGET_ARCH = i386pe
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
TARGET_ARCH = i386pe
ifeq ($(WINDOWS_BUILD),1)
ifeq ($(CROSS),i686-w64-mingw32.static-)
TARGET_ARCH = i386pe
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
TARGET_ARCH = i386pe
else
TARGET_ARCH ?= native
endif
else
TARGET_ARCH = native
TARGET_ARCH ?= native
endif
TARGET_BITS ?= 0
@ -508,6 +523,12 @@ ifeq ($(EXT_OPTIONS_MENU),1)
CFLAGS += -DEXT_OPTIONS_MENU
endif
# Check for no bzero/bcopy workaround option
ifeq ($(NO_BZERO_BCOPY),1)
CC_CHECK += -DNO_BZERO_BCOPY
CFLAGS += -DNO_BZERO_BCOPY
endif
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
ifeq ($(TARGET_WEB),1)

View file

@ -10,7 +10,7 @@
// macOS libc has them
#include <strings.h>
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) || defined(NO_BZERO_BCOPY)
// there's no way that shit's defined, use memcpy/memset
#include <string.h>