summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-10-23 09:43:14 -0400
committerGitHub <noreply@github.com>2021-10-23 09:43:14 -0400
commit65fb4681514d65881882648e803678e880b21bcb (patch)
tree25f5a7bff12d61f7d50434c297981e7dc6e89a1e
parent0fbf5f59b3e142ccfae0cb193f475ecd704c8746 (diff)
parent62436d9f67224e9df691c89222884146bd24263d (diff)
Merge pull request #1523 from Jademalo/ide-support
Improve IDE Support
-rw-r--r--berry_fix/payload/include/global.h23
-rw-r--r--include/global.h25
2 files changed, 24 insertions, 24 deletions
diff --git a/berry_fix/payload/include/global.h b/berry_fix/payload/include/global.h
index c218b5f4e..4bea138d6 100644
--- a/berry_fix/payload/include/global.h
+++ b/berry_fix/payload/include/global.h
@@ -6,17 +6,18 @@
// global.h from pokemon ruby
// IDE support
-#if defined(__APPLE__) || defined(__CYGWIN__)
-#define _(x) x
-#define __(x) x
-#define INCBIN(x) {0}
-#define INCBIN_U8 INCBIN
-#define INCBIN_U16 INCBIN
-#define INCBIN_U32 INCBIN
-#define INCBIN_S8 INCBIN
-#define INCBIN_S16 INCBIN
-#define INCBIN_S32 INCBIN
-#endif
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__INTELLISENSE__)
+// We define these when using certain IDEs to fool preproc
+#define _(x) (x)
+#define __(x) (x)
+#define INCBIN(...) {0}
+#define INCBIN_U8 INCBIN
+#define INCBIN_U16 INCBIN
+#define INCBIN_U32 INCBIN
+#define INCBIN_S8 INCBIN
+#define INCBIN_S16 INCBIN
+#define INCBIN_S32 INCBIN
+#endif // IDE support
// Prevent cross-jump optimization.
#define BLOCK_CROSS_JUMP asm("");
diff --git a/include/global.h b/include/global.h
index d14aa60f4..a919edddf 100644
--- a/include/global.h
+++ b/include/global.h
@@ -19,19 +19,18 @@
#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided")
#define NAKED __attribute__((naked))
-// IDE support
-#if defined (__APPLE__) || defined (__CYGWIN__) || defined (_MSC_VER)
-#define _(x) x
-#define __(x) x
-
-// Fool CLion IDE
-#define INCBIN(x) {0}
-#define INCBIN_U8 INCBIN
-#define INCBIN_U16 INCBIN
-#define INCBIN_U32 INCBIN
-#define INCBIN_S8 INCBIN
-#define INCBIN_S16 INCBIN
-#define INCBIN_S32 INCBIN
+/// IDE support
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__INTELLISENSE__)
+// We define these when using certain IDEs to fool preproc
+#define _(x) (x)
+#define __(x) (x)
+#define INCBIN(...) {0}
+#define INCBIN_U8 INCBIN
+#define INCBIN_U16 INCBIN
+#define INCBIN_U32 INCBIN
+#define INCBIN_S8 INCBIN
+#define INCBIN_S16 INCBIN
+#define INCBIN_S32 INCBIN
#endif // IDE support
#define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0]))