Add docker-build workarounds and container script

This commit is contained in:
MysterD 2020-09-04 17:02:09 -07:00
parent 4a2c218f11
commit 1bb0c90741
4 changed files with 16 additions and 2 deletions

View file

@ -50,6 +50,8 @@ TEXTSAVES ?= 0
EXTERNAL_DATA ?= 0
# Enable Discord Rich Presence
DISCORDRPC ?= 0
# Enable docker build workarounds
DOCKERBUILD ?= 0
# Various workarounds for weird toolchains
@ -578,6 +580,12 @@ ifeq ($(IMMEDIATELOAD),1)
CFLAGS += -DIMMEDIATELOAD
endif
# Check for docker build workaround option
ifeq ($(DOCKERBUILD),1)
CC_CHECK += -DDOCKERBUILD
CFLAGS += -DDOCKERBUILD
endif
# Check for Puppycam option
ifeq ($(BETTERCAMERA),1)
CC_CHECK += -DBETTERCAMERA

View file

@ -399,7 +399,7 @@ BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) {
#ifdef TEXTSAVES
static void save_file_load_textsaves(void) {
for (file = 0; file < NUM_SAVE_FILES; file++) {
for (int file = 0; file < NUM_SAVE_FILES; file++) {
read_text_save(file);
}
gSaveFileModified = TRUE;

View file

@ -5,7 +5,9 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef DOCKERBUILD
#include <dirent.h>
#endif
#include <ctype.h>
#ifdef _WIN32
#include <direct.h>
@ -389,6 +391,9 @@ bool fs_sys_dir_exists(const char *name) {
}
bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur) {
#ifdef DOCKERBUILD
return false;
#else
char fullpath[SYS_MAX_PATH];
DIR *dir;
struct dirent *ent;
@ -420,6 +425,7 @@ bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur)
closedir(dir);
return ret;
#endif
}
fs_pathlist_t fs_sys_enumerate(const char *base, const bool recur) {

View file

@ -2,7 +2,7 @@
#define SOCKET_WINDOWS_H
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <ws2tcpip.h>
#define SOCKET_LAST_ERROR WSAGetLastError()
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK