From b99a515ef2f9fc9f9df55a1a051e00db29365129 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Sat, 26 Jul 2014 23:23:52 +0800 Subject: [PATCH] Define RAPIDJSON_FORCEINLINE for gcc Performance boost a lot! --- include/rapidjson/rapidjson.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index 1608ce8..4aef17d 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -41,6 +41,8 @@ #ifndef RAPIDJSON_FORCEINLINE #ifdef _MSC_VER #define RAPIDJSON_FORCEINLINE __forceinline +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define RAPIDJSON_FORCEINLINE __attribute__((always_inline)) #else #define RAPIDJSON_FORCEINLINE #endif