From 80ff34fa9858a4c30425376c257b5711e9514bcf Mon Sep 17 00:00:00 2001 From: bitten2up Date: Tue, 14 Jan 2025 09:33:38 -0600 Subject: [PATCH 1/2] msys2 working --- songs.mk | 1 + src/platform/pret_sdl/sdl2.c | 2 +- tools/_shared/arena_alloc/ArenaAlloc.c | 2 +- tools/entity_positions/epos.c | 5 +---- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/songs.mk b/songs.mk index 92685e24f..369fa47f9 100644 --- a/songs.mk +++ b/songs.mk @@ -2,6 +2,7 @@ STD_REVERB = 0 $(MID_BUILDDIR)/%.o: $(MID_SUBDIR)/%.s @echo "$(AS) -I sound -o $@ $<" + dos2unix $< @$(PREPROC) $< "" | $(CPP) $(CPPFLAGS) - | $(AS) $(ASFLAGS) -o $@ - $(MID_SUBDIR)/mus_intro.s: %.s: %.mid diff --git a/src/platform/pret_sdl/sdl2.c b/src/platform/pret_sdl/sdl2.c index d9dc927f7..cd4d6691c 100644 --- a/src/platform/pret_sdl/sdl2.c +++ b/src/platform/pret_sdl/sdl2.c @@ -9,7 +9,7 @@ #include #endif -#include +#include #include "global.h" #include "core.h" diff --git a/tools/_shared/arena_alloc/ArenaAlloc.c b/tools/_shared/arena_alloc/ArenaAlloc.c index 35e273b52..6ecf1915e 100644 --- a/tools/_shared/arena_alloc/ArenaAlloc.c +++ b/tools/_shared/arena_alloc/ArenaAlloc.c @@ -34,7 +34,7 @@ static void memArenaExpand(MemArena *arena, s32 numNewArenas); // you'll be left with a downcast signed 32 bit value, even in 64bit mode // Behaviour in: VS Compiler v14.34.31937.0 u64 GetGigabytes(u64 num) { - return num*1024*1024*1024; + return num*1024*1024; } static void *memArenaVirtualAlloc(void* baseAddress, size_t size) { diff --git a/tools/entity_positions/epos.c b/tools/entity_positions/epos.c index c3d1c9fc7..e59280f83 100644 --- a/tools/entity_positions/epos.c +++ b/tools/entity_positions/epos.c @@ -1,7 +1,4 @@ -#if defined(__unix__) || defined(__unix) || \ - (defined(__APPLE__) && defined(__MACH__)) #include -#endif #include #include @@ -117,4 +114,4 @@ int main(int argc, char **argv) } return 0; -} \ No newline at end of file +} From 9103de7ea6e1af4d0af7ac6340a6deef9499b2a9 Mon Sep 17 00:00:00 2001 From: bitten2up Date: Wed, 15 Jan 2025 09:34:58 -0600 Subject: [PATCH 2/2] sdl --- src/platform/pret_sdl/sdl2.c | 2 +- tools/_shared/arena_alloc/ArenaAlloc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/pret_sdl/sdl2.c b/src/platform/pret_sdl/sdl2.c index cd4d6691c..d9dc927f7 100644 --- a/src/platform/pret_sdl/sdl2.c +++ b/src/platform/pret_sdl/sdl2.c @@ -9,7 +9,7 @@ #include #endif -#include +#include #include "global.h" #include "core.h" diff --git a/tools/_shared/arena_alloc/ArenaAlloc.c b/tools/_shared/arena_alloc/ArenaAlloc.c index 6ecf1915e..7f746ebec 100644 --- a/tools/_shared/arena_alloc/ArenaAlloc.c +++ b/tools/_shared/arena_alloc/ArenaAlloc.c @@ -33,7 +33,7 @@ static void memArenaExpand(MemArena *arena, s32 numNewArenas); // if you directly pass a value that is 2GB or more (0x80000000), // you'll be left with a downcast signed 32 bit value, even in 64bit mode // Behaviour in: VS Compiler v14.34.31937.0 -u64 GetGigabytes(u64 num) { +u64 GetMegabytes(u64 num) { return num*1024*1024; } @@ -51,11 +51,11 @@ static void *memArenaVirtualAlloc(void* baseAddress, size_t size) { } #elif (defined _MSC_VER) // TODO/TEMP: Just reserve 2GB for each arena - u64 memoryAmount = GetGigabytes(1); + u64 memoryAmount = GetMegabytes(1); memory = VirtualAlloc(baseAddress, memoryAmount, (MEM_COMMIT | MEM_RESERVE), PAGE_READWRITE); #else // TODO/TEMP: Just reserve 2GB for each arena - u64 memoryAmount = GetGigabytes(1); + u64 memoryAmount = GetMegabytes(1); printf("WARNING: OS-specific SDK not found. Using malloc.\n"); memory = malloc(memoryAmount);