Skip to content
Permalink
Browse files

Fix compiler errors with latest jfbuild and build on ARM

  • Loading branch information...
jdonald committed Nov 19, 2018
1 parent 8fc2d54 commit 92bf4a6728b167dd1a0cbba17c28057db5c45fc6
Showing with 19 additions and 10 deletions.
  1. +10 −1 Makefile
  2. +1 −1 src/StartupWinController.game.m
  3. +2 −2 src/game.c
  4. +4 −4 src/menus.c
  5. +1 −1 src/startgtk.game.c
  6. +1 −1 src/startwin.game.c
@@ -28,6 +28,11 @@ MACTROOT ?= jfmact
# JFAudioLib source path
AUDIOLIBROOT ?= jfaudiolib

# Don't use x86 assembly on ARM
ifneq (,$(shell uname -a | egrep 'arm|aarch64'))
NOASM ?= 1
endif

# Engine options
SUPERBUILD ?= 1
POLYMOST ?= 1
@@ -64,7 +69,7 @@ include $(AUDIOLIBROOT)/Makefile.shared
CC=gcc
CXX=g++
OURCFLAGS=$(debug) -W -Wall -Wimplicit -Wno-unused \
-fno-pic -fno-strict-aliasing -DNO_GCC_BUILTINS \
-fPIC -fno-strict-aliasing -DNO_GCC_BUILTINS \
-I$(INC) -I$(EINC) -I$(MACTROOT) -I$(AUDIOLIBROOT)/include
OURCXXFLAGS=-fno-exceptions -fno-rtti
LIBS=-lm
@@ -210,6 +215,10 @@ endif

all: sw$(EXESUFFIX) build$(EXESUFFIX)

# from jfbuild/Makefile, ideally should be moved to jfbuild/Makefile.shared:
OURCFLAGS+= $(SDLCONFIG_CFLAGS)
LIBS+= $(SDLCONFIG_LIBS)

sw$(EXESUFFIX): $(GAMEOBJS) $(ELIB)/$(ENGINELIB) $(AUDIOLIBROOT)/$(JFAUDIOLIB)
$(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(GAMELIBS) -Wl,-Map=$@.map

@@ -415,7 +415,7 @@ int startwin_idle(void *v)
extern char* grpfile;
extern int32 ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP, ForceSetup, UseMouse, UseJoystick;

int startwin_run(void)
int startwin_run(struct startwin_settings *settings)
{
int retval;

@@ -931,7 +931,7 @@ static char const * *netparam = NULL;
int nextvoxid = 0; // JBF
static const char *deffile = "sw.def";

extern int startwin_run(void);
extern int startwin_run(struct startwin_settings *settings);

VOID
InitGame(VOID)
@@ -3553,7 +3553,7 @@ int app_main(int argc, char const * const argv[])

#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && (defined __APPLE__ || defined HAVE_GTK2))
if (i < 0 || ForceSetup || CommandSetup) {
if (quitevent || !startwin_run()) {
if (quitevent || !startwin_run(NULL)) {
uninitengine();
exit(0);
}
@@ -1208,7 +1208,7 @@ static BOOL MNU_JoystickButtonsInitialise(MenuItem_p UNUSED(mitem))
joybuttonssetupgroup.items = joybuttons_i[0];
item = &joybuttons_i[0][0];

for (button = 0; button < joynumbuttons * 2 + (joynumhats > 0) * 4; ) {
for (button = 0; button < joynumbuttons * 2; ) {
if (button < joynumbuttons * 2) {
int dbutton = button / 2;

@@ -1269,10 +1269,10 @@ static BOOL MNU_JoystickButtonsInitialise(MenuItem_p UNUSED(mitem))
button++;
}

if (pageitem == JOYSTICKITEMSPERPAGE || button == joynumbuttons * 2 + (joynumhats > 0) * 4) {
if (pageitem == JOYSTICKITEMSPERPAGE || button == joynumbuttons * 2) {
// next page
sprintf(JoystickButtonPageName[page], "Page %d / %d", page+1,
((joynumbuttons * 2 + (joynumhats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
((joynumbuttons * 2) / JOYSTICKITEMSPERPAGE) + 1);

temppagename.text = JoystickButtonPageName[page];
memcpy(item, &temppagename, sizeof(MenuItem));
@@ -1356,7 +1356,7 @@ static BOOL MNU_JoystickButtonSetupCustom(UserCall call, MenuItem *item)

static BOOL MNU_JoystickButtonNextPage(void)
{
JoystickButtonPage = (JoystickButtonPage + 1) % (((joynumbuttons * 2 + (joynumhats > 0) * 4) / JOYSTICKITEMSPERPAGE) + 1);
JoystickButtonPage = (JoystickButtonPage + 1) % (((joynumbuttons * 2) / JOYSTICKITEMSPERPAGE) + 1);
joybuttonssetupgroup.items = &joybuttons_i[JoystickButtonPage][0];
joybuttonssetupgroup.cursor = 0;
MNU_ItemPreProcess(&joybuttonssetupgroup);
@@ -708,7 +708,7 @@ int startwin_idle(void *s)
extern int32 ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP, ForceSetup, UseMouse, UseJoystick;
extern char *grpfile; // game.c

int startwin_run(void)
int startwin_run(struct startwin_settings *settings)
{
if (!gtkenabled) return 0;
if (!startwin) return 1;
@@ -559,7 +559,7 @@ int startwin_idle(void *v)

extern char *grpfile; // game.c

int startwin_run(void)
int startwin_run(struct startwin_settings *settings)
{
MSG msg;
if (!startupdlg) return 1;

0 comments on commit 92bf4a6

Please sign in to comment.
You can’t perform that action at this time.