瀏覽代碼

Added BX_FALLTHROUGH.

Branimir Karadžić 8 年之前
父節點
當前提交
2443fa3873
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      include/bx/macros.h

+ 4 - 2
include/bx/macros.h

@@ -68,8 +68,9 @@
 #	define BX_FUNCTION __PRETTY_FUNCTION__
 #	define BX_FUNCTION __PRETTY_FUNCTION__
 #	define BX_LIKELY(_x)   __builtin_expect(!!(_x), 1)
 #	define BX_LIKELY(_x)   __builtin_expect(!!(_x), 1)
 #	define BX_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
 #	define BX_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
-#	define BX_NO_INLINE __attribute__( (noinline) )
-#	define BX_NO_RETURN __attribute__( (noreturn) )
+#	define BX_NO_INLINE   __attribute__( (noinline) )
+#	define BX_NO_RETURN   __attribute__( (noreturn) )
+#	define BX_FALLTHROUGH __attribute__ ((fallthrough));
 #	define BX_NO_VTABLE
 #	define BX_NO_VTABLE
 #	define BX_OVERRIDE
 #	define BX_OVERRIDE
 #	define BX_PRINTF_ARGS(_format, _args) __attribute__( (format(__printf__, _format, _args) ) )
 #	define BX_PRINTF_ARGS(_format, _args) __attribute__( (format(__printf__, _format, _args) ) )
@@ -92,6 +93,7 @@
 #	define BX_UNLIKELY(_x) (_x)
 #	define BX_UNLIKELY(_x) (_x)
 #	define BX_NO_INLINE __declspec(noinline)
 #	define BX_NO_INLINE __declspec(noinline)
 #	define BX_NO_RETURN
 #	define BX_NO_RETURN
+#	define BX_FALLTHROUGH BX_NOOP()
 #	define BX_NO_VTABLE __declspec(novtable)
 #	define BX_NO_VTABLE __declspec(novtable)
 #	define BX_OVERRIDE override
 #	define BX_OVERRIDE override
 #	define BX_PRINTF_ARGS(_format, _args)
 #	define BX_PRINTF_ARGS(_format, _args)