From db9124f1de0478dcac525009b6f1589b44a7edd8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 26 Apr 2019 16:59:41 -0700 Subject: Apply format changes from #2048 (#2059) Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048 --- src/compiler-support.h | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/compiler-support.h') diff --git a/src/compiler-support.h b/src/compiler-support.h index e7cb4db8c..911d92ef5 100644 --- a/src/compiler-support.h +++ b/src/compiler-support.h @@ -18,26 +18,34 @@ #define wasm_compiler_support_h #ifndef __has_feature -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #ifndef __has_builtin -# define __has_builtin(x) 0 +#define __has_builtin(x) 0 #endif // If control flow reaches the point of the WASM_UNREACHABLE(), the program is // undefined. #if __has_builtin(__builtin_unreachable) && defined(NDEBUG) -# define WASM_UNREACHABLE() __builtin_unreachable() +#define WASM_UNREACHABLE() __builtin_unreachable() #elif defined(_MSC_VER) -# define WASM_UNREACHABLE() __assume(false) +#define WASM_UNREACHABLE() __assume(false) #elif __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) -# include "sanitizer/common_interface_defs.h" -# define WASM_UNREACHABLE() do { __sanitizer_print_stack_trace(); __builtin_trap(); } while (0) +#include "sanitizer/common_interface_defs.h" +#define WASM_UNREACHABLE() \ + do { \ + __sanitizer_print_stack_trace(); \ + __builtin_trap(); \ + } while (0) #else -# include -# include -# define WASM_UNREACHABLE() do { assert(false); abort(); } while (0) +#include +#include +#define WASM_UNREACHABLE() \ + do { \ + assert(false); \ + abort(); \ + } while (0) #endif #ifdef __GNUC__ @@ -54,7 +62,11 @@ // The code might contain TODOs or stubs that read some values but do nothing // with them. The compiler might fail with [-Werror,-Wunused-variable]. // The WASM_UNUSED(varible) is a wrapper that helps to suppress the error. -#define WASM_UNUSED(expr) \ - do { if (sizeof expr) { (void)0; } } while (0) +#define WASM_UNUSED(expr) \ + do { \ + if (sizeof expr) { \ + (void)0; \ + } \ + } while (0) #endif // wasm_compiler_support_h -- cgit v1.2.3