summary refs log tree commit diff stats
path: root/lib/nimbase.h
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2023-06-15 16:09:33 -0300
committerGitHub <noreply@github.com>2023-06-15 21:09:33 +0200
commit0a19d78b228a2d2e7b5e2341edf45b5ee669196a (patch)
tree293f4dad202d640b3f1d262ab1676c0fd4aece60 /lib/nimbase.h
parent4937aa952b35975fdc76a627ab25116d9b38800b (diff)
downloadNim-0a19d78b228a2d2e7b5e2341edf45b5ee669196a.tar.gz
Revert the .inline semantics change (#22104)
Diffstat (limited to 'lib/nimbase.h')
-rw-r--r--lib/nimbase.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h
index 1b9268881..3a1289b6f 100644
--- a/lib/nimbase.h
+++ b/lib/nimbase.h
@@ -84,29 +84,20 @@ __AVR__
 #  define __DECLSPEC_SUPPORTED 1
 #endif
 
-
-/* Calling conventions and inline attributes for the supported C compilers */
-#if defined(__GNUC__) || defined(__clang__)  /* GCC and Clang */
-#  if __has_attribute(__forceinline)
-#    define N_INLINE(rettype, name) __attribute__((__forceinline)) rettype name
-#  else
-#    define N_INLINE(rettype, name) inline rettype name
-#  endif
-#elif defined(_MSC_VER)  /* MSVC */
-#  if _MSC_VER > 1200
-#    define N_INLINE(rettype, name) __forceinline rettype name
-#  else
-#    define N_INLINE(rettype, name) inline rettype name
-#  endif
-#elif defined(__TINYC__) || defined(__BORLANDC__)  /* TinyC and BorlandC */
-#  define N_INLINE(rettype, name) __inline rettype name
-#elif defined(__AVR__)  /* Atmel Advanced Virtual RISC */
+/* calling convention mess ----------------------------------------------- */
+#if defined(__GNUC__) || defined(__TINYC__)
+  /* these should support C99's inline */
 #  define N_INLINE(rettype, name) inline rettype name
-#else  /* Unsupported C compilers */
-#  define N_INLINE(rettype, name) rettype name
+#elif defined(__BORLANDC__) || defined(_MSC_VER)
+/* Borland's compiler is really STRANGE here; note that the __fastcall
+   keyword cannot be before the return type, but __inline cannot be after
+   the return type, so we do not handle this mess in the code generator
+   but rather here. */
+#  define N_INLINE(rettype, name) __inline rettype name
+#else /* others are less picky: */
+#  define N_INLINE(rettype, name) rettype __inline name
 #endif
 
-
 #define N_INLINE_PTR(rettype, name) rettype (*name)
 
 #if defined(__cplusplus)