Avoid windows.h in shared_memory.h
shared_memory.h ends up being included by consumers of webrtc such as Chromium so it causes namespace pollution. Specifically, it causes SendMessageCallback to be defined as SendMessageCallbackW partway through compilation of security_key_auth_handler_win_unittest.cc, leading to renaming of SendMessageCallback when it is used but not when it is defined. Bug: Chromium:796644 Change-Id: Ib1acc0d736a0a6cf97e318e773b20d9a432f6b77 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229901 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Joe Downing <joedow@chromium.org> Cr-Commit-Position: refs/heads/main@{#34887}
This commit is contained in:
parent
5af152c214
commit
126d0b932f
@ -14,7 +14,9 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
#include <windows.h>
|
||||
// Forward declare HANDLE in a windows.h compatible way so that we can avoid
|
||||
// including windows.h.
|
||||
typedef void* HANDLE;
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -11,6 +11,16 @@
|
||||
#ifndef MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURE_UTILS_H_
|
||||
#define MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURE_UTILS_H_
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
// Forward declare HMONITOR in a windows.h compatible way so that we can avoid
|
||||
// including windows.h.
|
||||
#define WEBRTC_DECLARE_HANDLE(name) \
|
||||
struct name##__; \
|
||||
typedef struct name##__* name
|
||||
WEBRTC_DECLARE_HANDLE(HMONITOR);
|
||||
#undef WEBRTC_DECLARE_HANDLE
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user