From 8fe23a065a6226a6fab1ce73523e7d5cb4763568 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 23 Nov 2022 17:24:37 +0100 Subject: [PATCH] Fix MSVC 12 (Visual Studio 2013) choking on inline Signed-off-by: Gilles Peskine --- library/common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/common.h b/library/common.h index c36615680b..0169325bb9 100644 --- a/library/common.h +++ b/library/common.h @@ -32,6 +32,12 @@ #include #include +/* Define `inline` on some non-C99-compliant compilers. */ +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) +#define inline __inline +#endif + /** Helper to define a function as static except when building invasive tests. * * If a function is only used inside its own source file and should be