From c71429c2b7fecdcbe396e05d8dc9d1f0df702dc5 Mon Sep 17 00:00:00 2001 From: Kenta Yoshimura Date: Mon, 8 Apr 2019 01:07:16 +0900 Subject: [PATCH] Merge `FORCE_INLINE` macro to `alwaysinline` into port.h. --- apu/bapu/snes/snes.hpp | 11 ----------- filter/xbrz.cpp | 13 ++----------- port.h | 8 ++++++++ 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/apu/bapu/snes/snes.hpp b/apu/bapu/snes/snes.hpp index e8dccfe0..eb6e8193 100644 --- a/apu/bapu/snes/snes.hpp +++ b/apu/bapu/snes/snes.hpp @@ -5,17 +5,6 @@ #include "../../resampler.h" #include "../../../msu1.h" -#if defined(__GNUC__) - #define inline inline - #define alwaysinline inline __attribute__((always_inline)) -#elif defined(_MSC_VER) - #define inline inline - #define alwaysinline inline __forceinline -#else - #define inline inline - #define alwaysinline inline -#endif - #define debugvirtual namespace SNES diff --git a/filter/xbrz.cpp b/filter/xbrz.cpp index 2f6b4b01..9033c0d1 100644 --- a/filter/xbrz.cpp +++ b/filter/xbrz.cpp @@ -74,15 +74,6 @@ uint32_t gradientARGB(uint32_t pixFront, uint32_t pixBack) //find intermediate c // -#ifdef _MSC_VER - #define FORCE_INLINE __forceinline -#elif defined __GNUC__ - #define FORCE_INLINE __attribute__((always_inline)) inline -#else - #define FORCE_INLINE inline -#endif - - enum RotationDegree //clock-wise { ROT_0, @@ -268,7 +259,7 @@ input kernel area naming convention: ----------------- */ template -FORCE_INLINE //detect blend direction +alwaysinline //detect blend direction BlendResult preProcessCorners(const Kernel_4x4& ker, const xbrz::ScalerCfg& cfg) //result: F, G, J, K corners of "GradientType" { BlendResult result = {}; @@ -378,7 +369,7 @@ input kernel area naming convention: ------------- */ template -FORCE_INLINE //perf: quite worth it! +alwaysinline //perf: quite worth it! void blendPixel(const Kernel_3x3& ker, uint32_t* target, int trgWidth, unsigned char blendInfo, //result of preprocessing all four corners of pixel "e" diff --git a/port.h b/port.h index 8b13951f..73ea7cb1 100644 --- a/port.h +++ b/port.h @@ -44,6 +44,14 @@ #define PIXEL_FORMAT RGB565 #endif +#if defined(__GNUC__) +#define alwaysinline inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define alwaysinline __forceinline +#else +#define alwaysinline inline +#endif + #ifndef snes9x_types_defined #define snes9x_types_defined typedef unsigned char bool8;