summaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 127b5d94e3c..925d9617af4 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -748,6 +748,24 @@ typedef NameData *Name;
#endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */
+/*
+ * Function inlining support -- Allow modules to define functions that may be
+ * inlined, if the compiler supports it.
+ *
+ * The function bodies must be defined in the module header prefixed by
+ * STATIC_IF_INLINE, protected by a cpp symbol that the module's .c file must
+ * define. If the compiler doesn't support inline functions, the function
+ * definitions are pulled in by the .c file as regular (not inline) symbols.
+ *
+ * The header must also declare the functions' prototypes, protected by
+ * !USE_INLINE.
+ */
+#ifdef USE_INLINE
+#define STATIC_IF_INLINE static inline
+#else
+#define STATIC_IF_INLINE
+#endif /* USE_INLINE */
+
/* ----------------------------------------------------------------
* Section 7: random stuff
* ----------------------------------------------------------------