summaryrefslogtreecommitdiff
path: root/upb/port_def.inc
diff options
context:
space:
mode:
Diffstat (limited to 'upb/port_def.inc')
-rw-r--r--upb/port_def.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/upb/port_def.inc b/upb/port_def.inc
index 3e0a7f4..1b7c335 100644
--- a/upb/port_def.inc
+++ b/upb/port_def.inc
@@ -45,14 +45,14 @@
/* UPB_INLINE: inline if possible, emit standalone code if required. */
#ifdef __cplusplus
#define UPB_INLINE inline
-#elif defined (__GNUC__)
+#elif defined (__GNUC__) || defined(__clang__)
#define UPB_INLINE static __inline__
#else
#define UPB_INLINE static
#endif
/* Hints to the compiler about likely/unlikely branches. */
-#ifdef __GNUC__
+#if defined (__GNUC__) || defined(__clang__)
#define UPB_LIKELY(x) __builtin_expect((x),1)
#define UPB_UNLIKELY(x) __builtin_expect((x),0)
#else
@@ -139,7 +139,7 @@ int msvc_snprintf(char* s, size_t n, const char* format, ...);
* exist in debug mode. This turns into regular assert. */
#define UPB_ASSERT_DEBUGVAR(expr) assert(expr)
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
#else
#define UPB_UNREACHABLE() do { assert(0); } while(0)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback