Fixes for compiling under msys2
authorMichael Georgoulopoulos <mgeorgoulopoulos@gmail.com>
Sun, 8 May 2022 18:37:03 +0000 (21:37 +0300)
committerMichael Georgoulopoulos <mgeorgoulopoulos@gmail.com>
Sun, 8 May 2022 18:37:03 +0000 (21:37 +0300)
GNUmakefile
src/bsptree.c
src/glut/audio.c
src/treestor.c
tools/csprite/src/main.c
tools/img2bin/Makefile

index ee7a35e..834db7b 100644 (file)
@@ -27,7 +27,7 @@ endif
 
 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/; s/IRIX.*/IRIX/')
 ifeq ($(sys), mingw)
-       obj = $(src:.c=.w32.o)
+       obj = $(src:.c=.w32.o) $(asmsrc:.asm=.w32.o)
 
        bin = demo_win32.exe
 
index 7db5711..d6417b9 100644 (file)
@@ -6,8 +6,12 @@
 #if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__DJGPP__)
 #include <malloc.h>
 #else
+#ifdef WIN32
+#include <malloc.h>
+#else
 #include <alloca.h>
 #endif
+#endif
 #include "bsptree.h"
 #include "dynarr.h"
 #include "inttypes.h"
index c776d3b..a7ea50c 100644 (file)
@@ -63,7 +63,7 @@ int au_init(void)
        {
 #ifdef _WIN32
                HANDLE thr;
-               if((thr = CreateThread(0, 0, update, 0, 0, 0))) {
+               if((thr = CreateThread(0, 0, upd_thread, 0, 0, 0))) {
                        CloseHandle(thr);
                }
 #else
@@ -169,7 +169,7 @@ void au_update(void)
 }
 
 #ifdef _WIN32
-static DWORD WINAPI upd_thread(void *cls);
+static DWORD WINAPI upd_thread(void *cls)
 #else
 static void *update(void *cls)
 #endif
index 91adfec..69853c8 100644 (file)
@@ -4,7 +4,7 @@
 #include <errno.h>
 #include "treestor.h"
 
-#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__DJGPP__)
+#if defined(__WATCOMC__) || defined(WIN32) || defined(__DJGPP__)
 #include <malloc.h>
 #else
 #include <alloca.h>
index a59aa3e..c549b3e 100644 (file)
@@ -3,7 +3,11 @@
 #include <string.h>
 #include <stdint.h>
 #include <assert.h>
+#ifdef WIN32
+#include <malloc.h>
+#else
 #include <alloca.h>
+#endif
 #include "image.h"
 
 struct rect {
index b6e9f4e..5e525cb 100644 (file)
@@ -4,7 +4,7 @@ bin = img2bin
 root = ../..
 
 CFLAGS = -pedantic -Wall -g -I$(root)/libs/imago/src
-LDFLAGS = -L$(root)/libs/imago -limago -lm
+LDFLAGS = -L$(root)/libs/imago -limago -lpng -ljpeg -lz -L/usr/local/lib -lm
 
 $(bin): $(obj)
        $(CC) -o $@ $(obj) $(LDFLAGS)