Remove all uses of the HAVE_CONFIG_H define.

BUG=
R=henrik.lundin@webrtc.org, pthatcher@google.com, stefan@webrtc.org, tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1820023004 .

Cr-Commit-Position: refs/heads/master@{#12141}
This commit is contained in:
Henrik Kjellander 2016-03-29 17:47:19 +02:00
parent 2f36c2399e
commit b252856d10
20 changed files with 152 additions and 87 deletions

View File

@ -14,10 +14,6 @@
#include <stddef.h> // for NULL, size_t
#include <stdint.h> // for uintptr_t and (u)int_t types.
#ifdef HAVE_CONFIG_H
#include "config.h" // NOLINT
#endif
// Detect compiler is for x86 or x64.
#if defined(__x86_64__) || defined(_M_X64) || \
defined(__i386__) || defined(_M_IX86)

View File

@ -46,10 +46,6 @@
#ifndef WEBRTC_BASE_LOGGING_H_
#define WEBRTC_BASE_LOGGING_H_
#ifdef HAVE_CONFIG_H
#include "config.h" // NOLINT
#endif
#include <list>
#include <sstream>
#include <string>

View File

@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "webrtc/base/network.h"
#if defined(WEBRTC_POSIX)

View File

@ -27,10 +27,6 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include "webrtc/base/arraysize.h"
#include "webrtc/base/common.h"
#include "webrtc/base/logging.h"

View File

@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#if HAVE_OPENSSL_SSL_H
#include "webrtc/base/opensslstreamadapter.h"

View File

@ -50,11 +50,6 @@
#include "webrtc/base/winping.h"
#include "webrtc/base/win32socketinit.h"
// stm: this will tell us if we are on OSX
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(WEBRTC_POSIX)
#include <netinet/tcp.h> // for TCP_NODELAY
#define IP_MTU 14 // Until this is integrated from linux/in.h to netinet/in.h

View File

@ -15,10 +15,6 @@
#include <shlobj.h>
#endif // WEBRTC_WIN
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
#include <SystemConfiguration/SystemConfiguration.h>
#include <CoreFoundation/CoreFoundation.h>

View File

@ -13,10 +13,6 @@
#include "webrtc/base/proxyinfo.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
namespace rtc {
// Auto-detect the proxy server. Returns true if a proxy is configured,
// although hostname may be empty if the proxy is not required for

View File

@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/sslconfig.h"

View File

@ -9,10 +9,6 @@
*/
// Handling of certificates and keypairs for SSLStreamAdapter's peer mode.
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include "webrtc/base/sslidentity.h"
#include <ctime>

View File

@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/sslconfig.h"

View File

@ -0,0 +1,140 @@
/*
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <vector>
#include "webrtc/base/sslstreamadapterhelper.h"
#include "webrtc/base/common.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/stream.h"
namespace rtc {
SSLStreamAdapterHelper::SSLStreamAdapterHelper(StreamInterface* stream)
: SSLStreamAdapter(stream),
state_(SSL_NONE),
role_(SSL_CLIENT),
ssl_error_code_(0), // Not meaningful yet
ssl_mode_(SSL_MODE_TLS),
ssl_max_version_(SSL_PROTOCOL_TLS_12) {}
SSLStreamAdapterHelper::~SSLStreamAdapterHelper() = default;
void SSLStreamAdapterHelper::SetIdentity(SSLIdentity* identity) {
ASSERT(identity_.get() == NULL);
identity_.reset(identity);
}
void SSLStreamAdapterHelper::SetServerRole(SSLRole role) {
role_ = role;
}
int SSLStreamAdapterHelper::StartSSLWithServer(const char* server_name) {
ASSERT(server_name != NULL && server_name[0] != '\0');
ssl_server_name_ = server_name;
return StartSSL();
}
int SSLStreamAdapterHelper::StartSSLWithPeer() {
ASSERT(ssl_server_name_.empty());
// It is permitted to specify peer_certificate_ only later.
return StartSSL();
}
void SSLStreamAdapterHelper::SetMode(SSLMode mode) {
ASSERT(state_ == SSL_NONE);
ssl_mode_ = mode;
}
void SSLStreamAdapterHelper::SetMaxProtocolVersion(SSLProtocolVersion version) {
ssl_max_version_ = version;
}
StreamState SSLStreamAdapterHelper::GetState() const {
switch (state_) {
case SSL_WAIT:
case SSL_CONNECTING:
return SS_OPENING;
case SSL_CONNECTED:
return SS_OPEN;
default:
return SS_CLOSED;
};
// not reached
}
bool SSLStreamAdapterHelper::GetPeerCertificate(SSLCertificate** cert) const {
if (!peer_certificate_)
return false;
*cert = peer_certificate_->GetReference();
return true;
}
bool SSLStreamAdapterHelper::SetPeerCertificateDigest(
const std::string &digest_alg,
const unsigned char* digest_val,
size_t digest_len) {
ASSERT(peer_certificate_.get() == NULL);
ASSERT(peer_certificate_digest_algorithm_.empty());
ASSERT(ssl_server_name_.empty());
size_t expected_len;
if (!GetDigestLength(digest_alg, &expected_len)) {
LOG(LS_WARNING) << "Unknown digest algorithm: " << digest_alg;
return false;
}
if (expected_len != digest_len)
return false;
peer_certificate_digest_value_.SetData(digest_val, digest_len);
peer_certificate_digest_algorithm_ = digest_alg;
return true;
}
void SSLStreamAdapterHelper::Error(const char* context, int err, bool signal) {
LOG(LS_WARNING) << "SSLStreamAdapterHelper::Error("
<< context << ", " << err << "," << signal << ")";
state_ = SSL_ERROR;
ssl_error_code_ = err;
Cleanup();
if (signal)
StreamAdapterInterface::OnEvent(stream(), SE_CLOSE, err);
}
void SSLStreamAdapterHelper::Close() {
Cleanup();
ASSERT(state_ == SSL_CLOSED || state_ == SSL_ERROR);
StreamAdapterInterface::Close();
}
int SSLStreamAdapterHelper::StartSSL() {
ASSERT(state_ == SSL_NONE);
if (StreamAdapterInterface::GetState() != SS_OPEN) {
state_ = SSL_WAIT;
return 0;
}
state_ = SSL_CONNECTING;
int err = BeginSSL();
if (err) {
Error("BeginSSL", err, false);
return err;
}
return 0;
}
} // namespace rtc

View File

@ -10,10 +10,6 @@
#include "xmppsocket.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include "webrtc/base/logging.h"
#include "webrtc/base/thread.h"

View File

@ -16,10 +16,6 @@
#include "webrtc/media/engine/webrtcmediaengine.h"
#endif // HAVE_WEBRTC_VOICE && HAVE_WEBRTC_VIDEO
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG
namespace cricket {
MediaEngineFactory::MediaEngineCreateFunction
@ -45,4 +41,4 @@ webrtc::RtpParameters CreateRtpParametersWithOneEncoding() {
return parameters;
}
}; // namespace cricket
}; // namespace cricket

View File

@ -10,10 +10,6 @@
#include "webrtc/media/engine/webrtcvideocapturer.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "webrtc/base/arraysize.h"
#include "webrtc/base/bind.h"
#include "webrtc/base/checks.h"

View File

@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_WEBRTC_VOICE
#include "webrtc/media/engine/webrtcvoiceengine.h"

View File

@ -7,7 +7,7 @@
*
* Copyright (C) 2005 Steve Underwood
*
* Despite my general liking of the GPL, I place my own contributions
* Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@ -30,10 +30,6 @@
/*! \file */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
@ -125,7 +121,7 @@ static void block4(G722DecoderState *s, int band, int d)
s->band[band].d[i] = s->band[band].d[i - 1];
s->band[band].b[i] = s->band[band].bp[i];
}
for (i = 2; i > 0; i--)
{
s->band[band].r[i] = s->band[band].r[i - 1];
@ -201,9 +197,9 @@ size_t WebRtc_g722_decode(G722DecoderState *s, int16_t amp[],
static const int wh[3] = {0, -214, 798};
static const int rh2[4] = {2, 1, 2, 1};
static const int qm2[4] = {-7408, -1616, 7408, 1616};
static const int qm4[16] =
static const int qm4[16] =
{
0, -20456, -12896, -8968,
0, -20456, -12896, -8968,
-6288, -4240, -2584, -1200,
20456, 12896, 8968, 6288,
4240, 2584, 1200, 0
@ -323,7 +319,7 @@ size_t WebRtc_g722_decode(G722DecoderState *s, int16_t amp[],
else if (wd1 > 18432)
wd1 = 18432;
s->band[0].nb = wd1;
/* Block 3L, SCALEL */
wd1 = (s->band[0].nb >> 6) & 31;
wd2 = 8 - (s->band[0].nb >> 11);
@ -331,7 +327,7 @@ size_t WebRtc_g722_decode(G722DecoderState *s, int16_t amp[],
s->band[0].det = wd3 << 2;
block4(s, 0, dlowt);
if (!s->eight_k)
{
/* Block 2H, INVQAH */
@ -354,7 +350,7 @@ size_t WebRtc_g722_decode(G722DecoderState *s, int16_t amp[],
else if (wd1 > 22528)
wd1 = 22528;
s->band[1].nb = wd1;
/* Block 3H, SCALEH */
wd1 = (s->band[1].nb >> 6) & 31;
wd2 = 10 - (s->band[1].nb >> 11);

View File

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Despite my general liking of the GPL, I place my own contributions
* Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@ -30,10 +30,6 @@
/*! \file */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
@ -122,7 +118,7 @@ static void block4(G722EncoderState *s, int band, int d)
s->band[band].d[i] = s->band[band].d[i - 1];
s->band[band].b[i] = s->band[band].bp[i];
}
for (i = 2; i > 0; i--)
{
s->band[band].r[i] = s->band[band].r[i - 1];
@ -311,7 +307,7 @@ size_t WebRtc_g722_encode(G722EncoderState *s, uint8_t g722_data[],
s->x[i] = s->x[i + 2];
s->x[22] = amp[j++];
s->x[23] = amp[j++];
/* Discard every other QMF output */
sumeven = 0;
sumodd = 0;
@ -371,7 +367,7 @@ size_t WebRtc_g722_encode(G722EncoderState *s, uint8_t g722_data[],
s->band[0].det = wd3 << 2;
block4(s, 0, dlow);
if (s->eight_k)
{
/* Just leave the high bits as zero */

View File

@ -10,10 +10,6 @@
#include "webrtc/pc/channelmanager.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <algorithm>
#include "webrtc/api/mediacontroller.h"

View File

@ -8,8 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#undef HAVE_CONFIG_H
#include "webrtc/pc/srtpfilter.h"
#include <string.h>