diff --git a/examples/peerconnection/client/main_wnd.h b/examples/peerconnection/client/main_wnd.h index f3ed2f576c..8edf81ffb3 100644 --- a/examples/peerconnection/client/main_wnd.h +++ b/examples/peerconnection/client/main_wnd.h @@ -20,7 +20,9 @@ #include "examples/peerconnection/client/peer_connection_client.h" #include "media/base/mediachannel.h" #include "media/base/videocommon.h" +#if defined(WEBRTC_WIN) #include "rtc_base/win32.h" +#endif // WEBRTC_WIN class MainWndCallback { public: diff --git a/media/engine/webrtcvideocapturer.cc b/media/engine/webrtcvideocapturer.cc index cf9eab6e6c..5bc3f46093 100644 --- a/media/engine/webrtcvideocapturer.cc +++ b/media/engine/webrtcvideocapturer.cc @@ -20,7 +20,10 @@ #include "rtc_base/timeutils.h" #include "modules/video_capture/video_capture_factory.h" + +#if defined(WEBRTC_WIN) #include "rtc_base/win32.h" // Need this to #include the impl files. +#endif // WEBRTC_WIN #include "system_wrappers/include/field_trial.h" namespace cricket { diff --git a/rtc_base/ipaddress.cc b/rtc_base/ipaddress.cc index 42a7fd6811..a31680d851 100644 --- a/rtc_base/ipaddress.cc +++ b/rtc_base/ipaddress.cc @@ -31,7 +31,10 @@ #include "rtc_base/logging.h" #include "rtc_base/nethelpers.h" #include "rtc_base/stringutils.h" + +#if defined(WEBRTC_WIN) #include "rtc_base/win32.h" +#endif // WEBRTC_WIN namespace rtc { diff --git a/rtc_base/openssladapter.cc b/rtc_base/openssladapter.cc index 7f62bcc5ec..ca5984a84a 100644 --- a/rtc_base/openssladapter.cc +++ b/rtc_base/openssladapter.cc @@ -14,8 +14,10 @@ #include #endif +#if defined(WEBRTC_WIN) // Must be included first before openssl headers. #include "rtc_base/win32.h" // NOLINT +#endif // WEBRTC_WIN #include #include diff --git a/rtc_base/opensslidentity.cc b/rtc_base/opensslidentity.cc index 726ae3b99c..477a0e61f7 100644 --- a/rtc_base/opensslidentity.cc +++ b/rtc_base/opensslidentity.cc @@ -12,8 +12,10 @@ #include +#if defined(WEBRTC_WIN) // Must be included first before openssl headers. #include "rtc_base/win32.h" // NOLINT +#endif // WEBRTC_WIN #include #include diff --git a/rtc_base/win32.h b/rtc_base/win32.h index 0cbc412c0a..78f66a77de 100644 --- a/rtc_base/win32.h +++ b/rtc_base/win32.h @@ -11,7 +11,9 @@ #ifndef RTC_BASE_WIN32_H_ #define RTC_BASE_WIN32_H_ -#if defined(WEBRTC_WIN) +#ifndef WEBRTC_WIN +#error "Only #include this header in Windows builds" +#endif #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -83,5 +85,4 @@ inline bool IsCurrentProcessLowIntegrity() { } // namespace rtc -#endif // WEBRTC_WIN #endif // RTC_BASE_WIN32_H_