Skip to content

Commit

Permalink
Improved "misc.c does not need to be compiled" message
Browse files Browse the repository at this point in the history
  • Loading branch information
gojimmypi committed Dec 29, 2023
1 parent 60a2960 commit 00e9399
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,20 @@
#if !defined(WOLFSSH_MISC_INCLUDED) && !defined(NO_INLINE) && \
!defined(WOLFSSH_IGNORE_FILE_WARN)
#define MISC_WARNING "misc.c does not need to be compiled when using inline (NO_INLINE not defined))"
#define MISC_STRINGIFY(x) #x
#define MISC_TOSTRING(x) MISC_STRINGIFY(x)
#ifdef __STDC_VERSION__
#if __STDC_VERSION__ >= 199901L
#define PRAGMA_SUPPORTED 1
#endif
#endif

#ifndef _MSC_VER
#warning MISC_WARNING
#else
#if (defined(__GNUC__) || defined(__clang__)) && defined(PRAGMA_SUPPORTED)
_Pragma(MISC_TOSTRING(message(MISC_WARNING)))
#elif defined(_MSC_VER)
#pragma message("warning: " MISC_WARNING)
#else
#warning MISC_WARNING
#endif

#else /* !WOLFSSL_MISC_INCLUDED && !NO_INLINE && !WOLFSSH_IGNORE_FILE_WARN */
Expand Down

0 comments on commit 00e9399

Please sign in to comment.