From bc717d84023eadd0fe94668f4034e4a09e4be9c9 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 15 Jun 2009 16:07:08 -0700 Subject: Implement inlining that works with both C99 and all versions of GCC. --- upb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'upb.h') 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 -- cgit v1.2.3