Commit 3ad4def4 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

include: Provide a definition of NOP_FUNCTION that works on GCC.

NOP_FUNCTION is a drop-in function replacement that ignores its arguments but also suppresses compiler warnings about them being unused. For example, on MSVC, 0(foo, bar, baz()); or __noop(foo, bar, baz()); would suppress warnings about foo and bar being unused and not call baz at all. Neither of those syntaxes is supported on GCC, which provides no similar way to suppress unused variable warnings, but we can at least allow such code to compile by defining NOP_FUNCTION to be an empty variadic macro. Signed-off-by: 's avatarAlex Henrie <alexhenrie24@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1cad3c00
......@@ -123,10 +123,14 @@ extern "C" {
#endif
#ifndef NOP_FUNCTION
# if defined(_MSC_VER) && (_MSC_VER >= 1210)
# define NOP_FUNCTION __noop
# if defined(_MSC_VER)
# if (_MSC_VER >= 1210)
# define NOP_FUNCTION __noop
# else
# define NOP_FUNCTION (void)0
# endif
# else
# define NOP_FUNCTION (void)0
# define NOP_FUNCTION(...)
# endif
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment