Gericom / GBARunner3

182 stars 24 forks source link

Missing `<string.h>` include causes compilation error #162

Open Diegovsky opened 2 weeks ago

Diegovsky commented 2 weeks ago

Compiling on Arch Linux, commit 1bd147ddfeaab423e62a6f8aad32d885617452a8, I get the following error:

/home/diegovsky/Downloads/GBARunner3/code/core/arm9/source/Fat/ff.c:684:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
  684 |         memset(dst, val, cnt);

I'm not sure if on Windows it is imported/defined automatically, but I ~hacked~fixed it by including <string.h> in the common.h file for both processors:

--- a/code/core/arm7/source/common.h
+++ b/code/core/arm7/source/common.h
@@ -1,2 +1,3 @@
 #pragma once
+#include <string.h>
 #include <nds.h>
diff --git a/code/core/arm9/source/common.h b/code/core/arm9/source/common.h
index 5e10188..fdad709 100644
--- a/code/core/arm9/source/common.h
+++ b/code/core/arm9/source/common.h
@@ -1,5 +1,6 @@
 #pragma once
 #include <nds/ndstypes.h>
+#include <string.h>
 #include <stddef.h>

 typedef u16 bool16;