Skip to content

Conversation

@mkannwischer
Copy link
Contributor

Restructure MLD_INLINE and MLD_ALWAYS_INLINE into separate blocks, each independently guarded:

MLD_INLINE:

  • MSVC: __inline
  • C99 or inline macro defined: inline
  • GCC/Clang C90: __attribute__((unused)) to silence warnings
  • Other C90: empty

MLD_ALWAYS_INLINE:

  • MSVC: __forceinline
  • GCC/Clang C99+: MLD_INLINE __attribute__((always_inline))
  • Other: MLD_INLINE (no forced inlining)

This fixes two issues:

  1. If inline was defined as a macro before including sys.h, the MSVC check was bypassed and __attribute__ was used, causing MSVC failures.
  2. For non-MSVC/GCC/Clang compilers like IAR, __attribute__ was used unconditionally, causing build failures.

Also fix typo: defined(clang) -> defined(__clang__)

@mkannwischer mkannwischer requested a review from a team as a code owner January 16, 2026 02:19
@mkannwischer
Copy link
Contributor Author

The commit message still says MLD_... that needs to be changed to MLK_ everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants