diff --git a/libs/libcommon/include/common/memory.h b/libs/libcommon/include/common/memory.h index d8dced79cfb..58070334ac1 100644 --- a/libs/libcommon/include/common/memory.h +++ b/libs/libcommon/include/common/memory.h @@ -15,10 +15,26 @@ #define USE_JEMALLOC 0 #include #endif +#else +#include #endif -#define ALWAYS_INLINE inline __attribute__((__always_inline__)) -#define NO_INLINE __attribute__((__noinline__)) +// Also defined in Core/Defines.h +#if !defined(ALWAYS_INLINE) +#if defined(_MSC_VER) + #define ALWAYS_INLINE inline __forceinline +#else + #define ALWAYS_INLINE inline __attribute__((__always_inline__)) +#endif +#endif + +#if !defined(NO_INLINE) +#if defined(_MSC_VER) + #define NO_INLINE static __declspec(noinline) +#else + #define NO_INLINE __attribute__((__noinline__)) +#endif +#endif namespace Memory {