[ Merge of http://go/wvgerrit/155070 ] These functions are internal utilities and should not be exported from our library. IIRC, this was added to aid in Windows tests, but this is no longer needed. Bug: 236317198 Test: build_and_run_all_unit_tests.sh Change-Id: I19beb35a15f0f87dc8f968e1dd5302aed9463e54
32 lines
800 B
C
32 lines
800 B
C
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
//
|
|
// Platform - Abstracts some utilities between platforms.
|
|
//
|
|
#ifndef WVCDM_UTIL_PLATFORM_H_
|
|
#define WVCDM_UTIL_PLATFORM_H_
|
|
|
|
#include "util_common.h"
|
|
|
|
#ifdef _WIN32
|
|
# include <BaseTsd.h>
|
|
# include <winsock2.h> // For htonl and ntohl.
|
|
# include <wtypes.h>
|
|
# define __PRETTY_FUNCTION__ __FUNCTION__
|
|
# undef NO_ERROR
|
|
# undef GetCurrentTime
|
|
# undef DeleteFile
|
|
|
|
using ssize_t = SSIZE_T;
|
|
|
|
inline void sleep(int seconds) { Sleep(seconds * 1000); }
|
|
int setenv(const char* key, const char* value, int overwrite);
|
|
#else
|
|
# include <arpa/inet.h>
|
|
# include <sys/types.h>
|
|
# include <unistd.h>
|
|
#endif
|
|
|
|
#endif // WVCDM_UTIL_PLATFORM_H_
|