ref: cfacf87e6a66325b258ca1f9c0c74cf1cfdec83a
parent: 589dbff606bc43e607f5ac157b4c725dcd75370a
author: cancel <[email protected]>
date: Sat Dec 1 09:40:29 EST 2018
Add ORCA_OPT_MINSIZE macro
--- a/base.h
+++ b/base.h
@@ -8,6 +8,17 @@
#include <string.h>
#include <unistd.h>
+// clang or gcc or msvc or other
+#if defined(__clang__)
+#define ORCA_OPT_MINSIZE __attribute__((minsize))
+#elif defined(__GNUC__)
+#define ORCA_OPT_MINSIZE __attribute__(("Os"))
+#elif defined(_MSC_VER)
+#define ORCA_OPT_MINSIZE
+#else
+#define ORCA_OPT_MINSIZE
+#endif
+
// (gcc / clang) or msvc or other
#if defined(__GNUC__) || defined(__clang__)
#define ORCA_FORCE_INLINE __attribute__((always_inline)) inline
--- a/sim.c
+++ b/sim.c
@@ -186,7 +186,7 @@
(void)Tick_number; \
(void)bank_params;
-#define OPER_PHASE_SPEC static ORCA_FORCE_NO_INLINE
+#define OPER_PHASE_SPEC ORCA_FORCE_NO_INLINE static
#define BEGIN_SOLO_PHASE_0(_oper_name) \
OPER_PHASE_SPEC void oper_phase0_##_oper_name(OPER_PHASE_0_COMMON_ARGS) { \