api: move _L macro where it belongs

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-11-03 11:42:48 +01:00
parent 04437fd668
commit 0c85a2ebf1
2 changed files with 2 additions and 7 deletions

View File

@ -7,13 +7,6 @@
#include <Windows.h> #include <Windows.h>
#ifndef __L
# define __L(x) L##x
#endif
#ifndef _L
# define _L(x) __L(x)
#endif
/* TODO: Replace with is_defined. MSVC has issues with the linux kernel varadic macro trick for this. */ /* TODO: Replace with is_defined. MSVC has issues with the linux kernel varadic macro trick for this. */
#if defined(_M_IX86) || defined(_M_ARM) #if defined(_M_IX86) || defined(_M_ARM)
# define MAYBE_WOW64 1 # define MAYBE_WOW64 1

View File

@ -28,6 +28,8 @@ LoggerLastError(_In_z_ const WCHAR *Prefix)
return Error; return Error;
} }
#define __L(x) L##x
#define _L(x) __L(x)
#define LOG(lvl, msg) (Logger((lvl), _L(__FUNCTION__) L": " msg)) #define LOG(lvl, msg) (Logger((lvl), _L(__FUNCTION__) L": " msg))
#define LOG_ERROR(msg, err) (LoggerError(_L(__FUNCTION__) L": " msg, (err))) #define LOG_ERROR(msg, err) (LoggerError(_L(__FUNCTION__) L": " msg, (err)))
#define LOG_LAST_ERROR(msg) (LoggerLastError(_L(__FUNCTION__) L": " msg)) #define LOG_LAST_ERROR(msg) (LoggerLastError(_L(__FUNCTION__) L": " msg))