[sanitizer] if WINAPI is already defined, do not redefine it

Summary: lib/sanitizer_common/sanitizer_win_defs.h defineds WINAPI, which is also defined by standard Windows headers. Redefining it causes warnings during compilation. This change causes us to only define WINAPI if it is not already defined, which avoids the warnings.

Reviewers: rnk, zturner, mpividori

Reviewed By: rnk, mpividori

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D29683

llvm-svn: 294497
This commit is contained in:
Bob Haarman 2017-02-08 18:34:05 +00:00
parent e332a5b670
commit d93d7754c4
1 changed files with 2 additions and 0 deletions

View File

@ -16,11 +16,13 @@
#include "sanitizer_platform.h"
#if SANITIZER_WINDOWS
#ifndef WINAPI
#ifdef _M_IX86
#define WINAPI __stdcall
#else
#define WINAPI
#endif
#endif
#if defined(_WIN64)
#define WIN_SYM_PREFIX