2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

Add BUILD_MESSAGE() macro

This commit introduces the BUILD_MESSAGE() macro. It uses _Pragma("message"),
with compilers that support that, to output a warning-like compile-time message
without blocking the compilation.

Used by next commit.

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Daniele Di Proietto
2014-08-29 16:08:11 -07:00
committed by Jarno Rajahalme
parent 30f4d875f5
commit aa8ea22366
3 changed files with 20 additions and 0 deletions

View File

@@ -221,4 +221,14 @@
#define OVS_PREFETCH_WRITE(addr)
#endif
/* Output a message (not an error) while compiling without failing the
* compilation process */
#if HAVE_PRAGMA_MESSAGE
#define DO_PRAGMA(x) _Pragma(#x)
#define BUILD_MESSAGE(x) \
DO_PRAGMA(message(x))
#else
#define BUILD_MESSAGE(x)
#endif
#endif /* compiler.h */