Avoid to unconditionally include rtc_base/win32.h.

This CL adds #error to spot where rtc_base/win32.h is unconditionally
included and fixes all the places where it happens.

Bug: webrtc:8814
Change-Id: I3c005acf2cdb58a51f1bcaa4acaeebd272c56660
Reviewed-on: https://webrtc-review.googlesource.com/46060
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21840}
This commit is contained in:
Mirko Bonadei 2018-02-01 11:17:40 +01:00 committed by Commit Bot
parent 06c944f035
commit e062385dc7
6 changed files with 15 additions and 2 deletions

View file

@ -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:

View file

@ -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 {

View file

@ -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 {

View file

@ -14,8 +14,10 @@
#include <unistd.h>
#endif
#if defined(WEBRTC_WIN)
// Must be included first before openssl headers.
#include "rtc_base/win32.h" // NOLINT
#endif // WEBRTC_WIN
#include <openssl/bio.h>
#include <openssl/crypto.h>

View file

@ -12,8 +12,10 @@
#include <memory>
#if defined(WEBRTC_WIN)
// Must be included first before openssl headers.
#include "rtc_base/win32.h" // NOLINT
#endif // WEBRTC_WIN
#include <openssl/bio.h>
#include <openssl/bn.h>

View file

@ -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_