Better compatibility with old gcc

This commit is contained in:
UnknownShadow200 2024-10-31 20:01:31 +11:00
parent a3b4a6dc03
commit fba21fe979
5 changed files with 11 additions and 9 deletions

View file

@ -114,7 +114,8 @@ ifeq ($(PLAT),haiku)
OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o
CFLAGS = -pipe -fno-math-errno CFLAGS = -pipe -fno-math-errno
LDFLAGS = -g LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker LINK = $(CXX)
LIBS = -lGL -lnetwork -lbe -lgame -ltracker
BUILD_DIR = build-haiku BUILD_DIR = build-haiku
endif endif
@ -122,7 +123,8 @@ ifeq ($(PLAT),beos)
OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o
CFLAGS = -pipe CFLAGS = -pipe
LDFLAGS = -g LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker LINK = $(CXX)
LIBS = -lGL -lnetwork -lbe -lgame -ltracker
BUILD_DIR = build-beos BUILD_DIR = build-beos
TRACK_DEPENDENCIES=0 TRACK_DEPENDENCIES=0
endif endif

View file

@ -360,14 +360,14 @@ Run `make saturn`. You'll need [libyaul](https://github.com/yaul-org/libyaul)
1. Install `gcc`, `haiku_devel`, `openal_devel` packages if needed 1. Install `gcc`, `haiku_devel`, `openal_devel` packages if needed
2. Run either: 2. Run either:
* `make haiku` or * `make haiku` or
* `cc -fno-math-errno src/*.c interop_BeOS.cpp -o ClassiCube -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker` * `cc -fno-math-errno src/*.c src/*.cpp -o ClassiCube -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker`
#### BeOS #### BeOS
1. Install a C compiler 1. Install a C compiler
2. Run either: 2. Run either:
* `make beos` or * `make beos` or
* `cc -fno-math-errno src/*.c interop_BeOS.cpp -o ClassiCube -lGL -lbe -lgame -ltracker` * `cc -fno-math-errno src/*.c src/*.cpp -o ClassiCube -lGL -lbe -lgame -ltracker`
#### IRIX #### IRIX

View file

@ -416,10 +416,10 @@ static void* ExecThread(void* param) {
void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* name) { void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* name) {
pthread_t* ptr = (pthread_t*)Mem_Alloc(1, sizeof(pthread_t), "thread"); pthread_t* ptr = (pthread_t*)Mem_Alloc(1, sizeof(pthread_t), "thread");
int res;
*handle = ptr;
pthread_attr_t attrs; pthread_attr_t attrs;
int res;
*handle = ptr;
pthread_attr_init(&attrs); pthread_attr_init(&attrs);
pthread_attr_setstacksize(&attrs, stackSize); pthread_attr_setstacksize(&attrs, stackSize);

View file

@ -67,7 +67,7 @@ extern struct IGameComponent Protocol_Component;
void Protocol_Tick(void); void Protocol_Tick(void);
extern cc_bool cpe_needD3Fix; extern cc_bool cpe_needD3Fix;
void Classic_SendChat(const cc_string* text, cc_bool partial);\ void Classic_SendChat(const cc_string* text, cc_bool partial);
void Classic_SendSetBlock(int x, int y, int z, cc_bool place, BlockID block); void Classic_SendSetBlock(int x, int y, int z, cc_bool place, BlockID block);
void Classic_SendLogin(void); void Classic_SendLogin(void);
void CPE_SendPlayerClick(int button, cc_bool pressed, cc_uint8 targetId, struct RayTracer* t); void CPE_SendPlayerClick(int button, cc_bool pressed, cc_uint8 targetId, struct RayTracer* t);

View file

@ -196,7 +196,7 @@ static void UpdateMouseButtons(int buttons) {
} }
static void HandleMouseMovement(BMessage* msg) { static void HandleMouseMovement(BMessage* msg) {
int dx, dy; int32 dx, dy;
float prs; float prs;
if (msg->FindInt32("be:delta_x", &dx) == B_OK && if (msg->FindInt32("be:delta_x", &dx) == B_OK &&