Add some platform abstractions.

(This is a merge of http://go/wvgerrit/70303)

This adds a platform.h file to abstract some of the differences
between Windows and POSIX platforms.  This includes ntohl, setenv,
and ssize_t.

Bug: 122953649
Test: Android Unit Tests
Change-Id: I3235f3f284b53d24d7365ff3f4a06dcd9b403697
This commit is contained in:
John W. Bruce
2019-01-15 16:53:22 -08:00
parent 1cd093795e
commit 777abaef01
21 changed files with 74 additions and 20 deletions

View File

@@ -5,14 +5,13 @@
#ifndef WVCDM_CORE_DEVICE_FILES_H_
#define WVCDM_CORE_DEVICE_FILES_H_
#include <unistd.h>
#include <set>
#include <string>
#include <vector>
#include "device_files.pb.h"
#include "disallow_copy_and_assign.h"
#include "platform.h"
#include "wv_cdm_types.h"
#if defined(UNIT_TEST)

View File

@@ -5,6 +5,7 @@
#include "buffer_reader.h"
#include "log.h"
#include "platform.h"
namespace wvcdm {

View File

@@ -7,7 +7,6 @@
#include "crypto_session.h"
#include <arpa/inet.h> // needed for ntoh()
#include <string.h>
#include <algorithm>
#include <iostream>
@@ -20,6 +19,7 @@
#include "openssl/asn1.h"
#include "openssl/sha.h"
#include "openssl/x509v3.h"
#include "platform.h"
#include "properties.h"
#include "pst_report.h"
#include "string_conversions.h"

View File

@@ -4,7 +4,6 @@
#include "initialization_data.h"
#include <arpa/inet.h>
#include <string.h>
#include <sstream>
@@ -12,6 +11,7 @@
#include "cdm_engine.h"
#include "jsmn.h"
#include "log.h"
#include "platform.h"
#include "properties.h"
#include "string_conversions.h"
#include "wv_cdm_constants.h"

View File

@@ -4,7 +4,6 @@
#include "license.h"
#include <arpa/inet.h>
#include <sstream>
#include <vector>
@@ -15,6 +14,7 @@
#include "crypto_session.h"
#include "device_files.h"
#include "log.h"
#include "platform.h"
#include "policy_engine.h"
#include "privacy_crypto.h"
#include "properties.h"

View File

@@ -4,7 +4,6 @@
#include <string>
#include <errno.h>
#include <getopt.h>
#include <gtest/gtest.h>
#include "buffer_reader.h"

View File

@@ -2,7 +2,6 @@
// source code may only be used and distributed under the Widevine Master
// License Agreement.
#include <arpa/inet.h>
#include <memory>
#include <string>
@@ -13,6 +12,7 @@
#include "key_session.h"
#include "license_protocol.pb.h"
#include "log.h"
#include "platform.h"
#include "metrics.pb.h"
#include "metrics_collections.h"
#include "test_base.h"

View File

@@ -7,7 +7,6 @@
// This is because we need a valid RSA certificate, and will attempt to connect
// to the provisioning server to request one if we don't.
#include <arpa/inet.h>
#include <gtest/gtest.h>
#include <memory>
#include <string>
@@ -19,6 +18,7 @@
#include "oec_session_util.h"
#include "oemcrypto_session_tests_helper.h"
#include "oemcrypto_types.h"
#include "platform.h"
#include "properties.h"
#include "string_conversions.h"
#include "test_base.h"

View File

@@ -2,13 +2,13 @@
// source code may only be used and distributed under the Widevine Master
// License Agreement.
#include <arpa/inet.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "file_store.h"
#include "initialization_data.h"
#include "license_protocol.pb.h"
#include "platform.h"
#include "string_conversions.h"
#include "wv_cdm_constants.h"

View File

@@ -21,6 +21,7 @@
#include "log.h"
#include "oec_device_features.h"
#include "oec_test_data.h"
#include "platform.h"
#include "properties.h"
#include "test_printers.h"
#include "url_request.h"