mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00

Among other things: - #include <stdafx.h> -> #include "stdafx.h" - Multi-line macros no longer start on the #define line. - No space between __attribute__ and the attribute. - TODO: Switch to C++11's [[attribute]] syntax? - Two-space indents for nested #if/#elif/#endif. - Sort includes alphabetically, except for stdafx.h and the "main" header, which go at the top. Mostly updated the following: - Base files - gtk/ - kde/ - A few others, but nothing Windows-specific yet.
37 lines
1.4 KiB
C
37 lines
1.4 KiB
C
/***************************************************************************
|
|
* ROM Properties Page shell extension. *
|
|
* force_inline.h: FORCEINLINE macro. *
|
|
* *
|
|
* Copyright (c) 2016-2023 by David Korth. *
|
|
* SPDX-License-Identifier: GPL-2.0-or-later *
|
|
***************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
// NOTE: MinGW's __forceinline macro has an extra 'extern' when compiling as C code.
|
|
// This breaks "static FORCEINLINE".
|
|
// Reference: https://sourceforge.net/p/mingw-w64/mailman/message/32882927/
|
|
#if !defined(__cplusplus) && defined(__forceinline) && defined(__GNUC__) && defined(_WIN32)
|
|
# undef __forceinline
|
|
# define __forceinline inline __attribute__((always_inline, __gnu_inline__))
|
|
#endif
|
|
|
|
// Force inline attribute.
|
|
#if !defined(FORCEINLINE)
|
|
# if (!defined(_DEBUG) || defined(NDEBUG))
|
|
# if defined(__GNUC__)
|
|
# define FORCEINLINE inline __attribute__((always_inline))
|
|
# elif defined(_MSC_VER)
|
|
# define FORCEINLINE __forceinline
|
|
# else
|
|
# define FORCEINLINE inline
|
|
# endif
|
|
# else
|
|
# ifdef _MSC_VER
|
|
# define FORCEINLINE __inline
|
|
# else
|
|
# define FORCEINLINE inline
|
|
# endif
|
|
# endif
|
|
#endif /* !defined(FORCEINLINE) */
|