diff --git a/modules/desktop_capture/shared_memory.h b/modules/desktop_capture/shared_memory.h index 2e2d2f3388..49a9252c1b 100644 --- a/modules/desktop_capture/shared_memory.h +++ b/modules/desktop_capture/shared_memory.h @@ -14,7 +14,9 @@ #include #if defined(WEBRTC_WIN) -#include +// Forward declare HANDLE in a windows.h compatible way so that we can avoid +// including windows.h. +typedef void* HANDLE; #endif #include diff --git a/modules/desktop_capture/win/screen_capture_utils.h b/modules/desktop_capture/win/screen_capture_utils.h index 1e0541b5b8..ac60c5abc5 100644 --- a/modules/desktop_capture/win/screen_capture_utils.h +++ b/modules/desktop_capture/win/screen_capture_utils.h @@ -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 #include