For context, see cl/578224540
This CL is produced via
- Do the removal
- `$ /google/src/head/depot/google3/devtools/scripts/csearch_apply --includefile 'video/widevine/export/common/oemcrypto_core_message/' --search='Copyright \d{4} Google LLC. All rights reserved.' --apply='s,\ All rights reserved\.,,g'`
- Manually deleted a few periods. I.e., for cases where the comment is ONLY "Copyright <year> Google LLC.", I removed the period at the end.
PiperOrigin-RevId: 580020267
Change-Id: I4b2f647d6e3bbb34868e1822591bc953a94cca42
50 lines
1.5 KiB
C
50 lines
1.5 KiB
C
// Copyright 2019 Google LLC. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine
|
|
// License Agreement.
|
|
|
|
#ifndef WIDEVINE_ODK_SRC_ODK_ENDIAN_H_
|
|
#define WIDEVINE_ODK_SRC_ODK_ENDIAN_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#if defined(__linux__) || defined(__ANDROID__)
|
|
#include <endian.h>
|
|
#define oemcrypto_htobe16 htobe16
|
|
#define oemcrypto_be16toh be16toh
|
|
#define oemcrypto_htobe32 htobe32
|
|
#define oemcrypto_be32toh be32toh
|
|
#define oemcrypto_htobe64 htobe64
|
|
#define oemcrypto_be64toh be64toh
|
|
#elif defined(__APPLE__)
|
|
#include <libkern/OSByteOrder.h>
|
|
#define oemcrypto_htobe16 OSSwapHostToBigInt16
|
|
#define oemcrypto_be16toh OSSwapBigToHostInt16
|
|
#define oemcrypto_htobe32 OSSwapHostToBigInt32
|
|
#define oemcrypto_be32toh OSSwapBigToHostInt32
|
|
#define oemcrypto_htobe64 OSSwapHostToBigInt64
|
|
#define oemcrypto_be64toh OSSwapBigToHostInt64
|
|
#elif defined(_WIN32)
|
|
#include <winsock2.h>
|
|
#define oemcrypto_htobe16 htons
|
|
#define oemcrypto_be16toh ntohs
|
|
#define oemcrypto_htobe32 htonl
|
|
#define oemcrypto_be32toh ntohl
|
|
#define oemcrypto_htobe64 htonll
|
|
#define oemcrypto_be64toh ntohll
|
|
#else /* defined(__linux__) || defined(__ANDROID__) */
|
|
uint32_t oemcrypto_htobe16(uint16_t u16);
|
|
uint32_t oemcrypto_be16toh(uint16_t u16);
|
|
uint32_t oemcrypto_htobe32(uint32_t u32);
|
|
uint32_t oemcrypto_be32toh(uint32_t u32);
|
|
uint64_t oemcrypto_htobe64(uint64_t u64);
|
|
uint64_t oemcrypto_be64toh(uint64_t u64);
|
|
#endif /* defined(__linux__) || defined(__ANDROID__) */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // WIDEVINE_ODK_SRC_ODK_ENDIAN_H_
|