summaryrefslogtreecommitdiff
path: root/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-06-15 16:07:08 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-06-15 16:07:08 -0700
commitbc717d84023eadd0fe94668f4034e4a09e4be9c9 (patch)
tree096101da08c88808df5e8431ded8f47fde0a47a3 /upb.h
parentccca4d71360776f5589312525b2397c84ad0096d (diff)
Implement inlining that works with both C99 and all versions of GCC.
Diffstat (limited to 'upb.h')
-rw-r--r--upb.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/upb.h b/upb.h
index b09a39c..ae1845a 100644
--- a/upb.h
+++ b/upb.h
@@ -15,6 +15,16 @@
extern "C" {
#endif
+/* Portable inlining strategy: use C99 rules except on GCC.
+ * see: http://www.greenend.org.uk/rjk/2003/03/inline.html. */
+#ifndef INLINE
+# if __GNUC__ && !__GNUC_STDC_INLINE__
+# define INLINE extern inline
+# else
+# define INLINE inline
+# endif
+#endif
+
/* The maximum that any submessages can be nested. Matches proto2's limit. */
#define UPB_MAX_NESTING 64
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback