summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-12-01 20:54:24 -0800
committerGitHub <noreply@github.com>2022-12-02 04:54:24 +0000
commitdbb81d7ce7cc24239abfdeae393eacb18b8ee93b (patch)
tree22f98d49e2817e9ccc16c268a6a0a1def1198174
parent897bb6764edc7fc3291a5791e4b9d96741c42681 (diff)
downloadwabt-dbb81d7ce7cc24239abfdeae393eacb18b8ee93b.tar.gz
wabt-dbb81d7ce7cc24239abfdeae393eacb18b8ee93b.tar.bz2
wabt-dbb81d7ce7cc24239abfdeae393eacb18b8ee93b.zip
Use inline keyword over WABT_INLINE. NFC (#2092)
I'm not sure this was ever needed. `__inline` and `inline` are identical under msvc: https://learn.microsoft.com/en-us/cpp/cpp/inline-functions-cpp?view=msvc-170 "The __inline keyword is equivalent to inline"
-rw-r--r--include/wabt/common.h6
-rw-r--r--include/wabt/error.h2
-rw-r--r--src/config.h.in2
3 files changed, 4 insertions, 6 deletions
diff --git a/include/wabt/common.h b/include/wabt/common.h
index 87613791..da72a7bb 100644
--- a/include/wabt/common.h
+++ b/include/wabt/common.h
@@ -391,7 +391,7 @@ void InitStdio();
extern const char* g_kind_name[];
-static WABT_INLINE const char* GetKindName(ExternalKind kind) {
+static inline const char* GetKindName(ExternalKind kind) {
return static_cast<size_t>(kind) < kExternalKindCount
? g_kind_name[static_cast<size_t>(kind)]
: "<error_kind>";
@@ -401,7 +401,7 @@ static WABT_INLINE const char* GetKindName(ExternalKind kind) {
extern const char* g_reloc_type_name[];
-static WABT_INLINE const char* GetRelocTypeName(RelocType reloc) {
+static inline const char* GetRelocTypeName(RelocType reloc) {
return static_cast<size_t>(reloc) < kRelocTypeCount
? g_reloc_type_name[static_cast<size_t>(reloc)]
: "<error_reloc_type>";
@@ -409,7 +409,7 @@ static WABT_INLINE const char* GetRelocTypeName(RelocType reloc) {
/* symbol */
-static WABT_INLINE const char* GetSymbolTypeName(SymbolType type) {
+static inline const char* GetSymbolTypeName(SymbolType type) {
switch (type) {
case SymbolType::Function:
return "func";
diff --git a/include/wabt/error.h b/include/wabt/error.h
index 9ea55e95..d16e1e65 100644
--- a/include/wabt/error.h
+++ b/include/wabt/error.h
@@ -30,7 +30,7 @@ enum class ErrorLevel {
Error,
};
-static WABT_INLINE const char* GetErrorLevelName(ErrorLevel error_level) {
+static inline const char* GetErrorLevelName(ErrorLevel error_level) {
switch (error_level) {
case ErrorLevel::Warning:
return "warning";
diff --git a/src/config.h.in b/src/config.h.in
index c83b3214..afba03b0 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -66,7 +66,6 @@
#if COMPILER_IS_CLANG || COMPILER_IS_GNU
-#define WABT_INLINE inline
#define WABT_UNLIKELY(x) __builtin_expect(!!(x), 0)
#define WABT_LIKELY(x) __builtin_expect(!!(x), 1)
@@ -94,7 +93,6 @@
#include <intrin.h>
#include <string.h>
-#define WABT_INLINE __inline
#define WABT_STATIC_ASSERT(x) _STATIC_ASSERT(x)
#define WABT_UNLIKELY(x) (x)
#define WABT_LIKELY(x) (x)