rom-properties/src/force_inline.h
David Korth f6624f9621 Apply a subset of the clang-format changes.
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.
2023-07-02 00:12:38 -04:00

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) */