From 2c3d78b4a6bd2be2e611c9a9705464dc52df53e9 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 9 Aug 2016 10:44:33 -0700 Subject: [PATCH] Change misc.c error to warning and exclude the misc.c code from being compiled. Most people include all .c files and by default inlining is allowed, which in turn causes an #error in misc.c and it must be excluded. Since we know its already been properly included there is no reason to throw error here. Instead, show warning and exclude code in .c file. Copied from wolfSSL pull request #521. --- src/misc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/misc.c b/src/misc.c index 493163b..a841dcb 100644 --- a/src/misc.c +++ b/src/misc.c @@ -49,8 +49,10 @@ /* Check for if compiling misc.c when not needed. */ #if !defined(WOLFSSH_MISC_INCLUDED) && !defined(NO_INLINE) - #error misc.c does not need to be compiled when not defined NO_INLINE -#endif + + #warning misc.c does not need to be compiled when using inline (NO_INLINE not defined) + +#else /* !WOLFSSL_MISC_INCLUDED && !NO_INLINE */ #ifndef min @@ -105,4 +107,7 @@ STATIC INLINE int ConstantCompare(const uint8_t* a, const uint8_t* b, #undef STATIC +#endif /* !WOLFSSL_MISC_INCLUDED && !NO_INLINE */ + + #endif /* WOLFSSH_MISC_C */