summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2025-01-13 05:32:25 -0800
committerGitHub <noreply@github.com>2025-01-13 08:32:25 -0500
commitbdc6b5015374cdedcc7b599d3774537bc2802ae1 (patch)
tree36a761b84d1efb5ead691646ed64b9cf94939188 /include
parentdbfa95fd01d486ab709d74428c5f666dcc0208ee (diff)
[iQue] Define EGCS macro instead of relying on `__GNUC__` (#2423)
* [iQue] Define EGCS macro instead of relying on __GNUC__ * Revert longlong.h
Diffstat (limited to 'include')
-rw-r--r--include/libc/stdarg.h21
-rw-r--r--include/macros.h4
2 files changed, 12 insertions, 13 deletions
diff --git a/include/libc/stdarg.h b/include/libc/stdarg.h
index 7c7d2800e..717299ccd 100644
--- a/include/libc/stdarg.h
+++ b/include/libc/stdarg.h
@@ -1,16 +1,7 @@
#ifndef STDARG_H
#define STDARG_H
-// When building with modern GCC, use the official vaarg macros to avoid warnings and possibly bad codegen.
-
-#if __GNUC__ >= 3
-
-#define va_list __builtin_va_list
-#define va_start __builtin_va_start
-#define va_arg __builtin_va_arg
-#define va_end __builtin_va_end
-
-#elif defined(__sgi) /* IDO */
+#if defined(__sgi) /* IDO */
#ifndef _VA_LIST_
# define _VA_LIST_
@@ -52,7 +43,7 @@ typedef char* va_list;
/* No cleanup processing is required for the end of a varargs list: */
#define va_end(__list)
-#else /* EGCS */
+#elif defined(EGCS) /* EGCS */
typedef char * __gnuc_va_list;
@@ -75,6 +66,14 @@ typedef char * __gnuc_va_list;
typedef __gnuc_va_list va_list;
+#else /* Modern GCC */
+
+// When building with modern GCC, use the official vaarg macros to avoid warnings and possibly bad codegen.
+#define va_list __builtin_va_list
+#define va_start __builtin_va_start
+#define va_arg __builtin_va_arg
+#define va_end __builtin_va_end
+
#endif
#endif
diff --git a/include/macros.h b/include/macros.h
index d7547482c..c5264ba6a 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -52,10 +52,10 @@
#if DEBUG_FEATURES
#define PRINTF osSyncPrintf
+#elif defined(EGCS)
+#define PRINTF(format, args...) while (0) osSyncPrintf(format, ##args)
#elif IDO_PRINTF_WORKAROUND
#define PRINTF(args) (void)0
-#elif defined(__GNUC__) && __GNUC__ < 3
-#define PRINTF(format, args...) while (0) osSyncPrintf(format, ##args)
#else
#define PRINTF(format, ...) (void)0
#endif