Define uint64 and int64 using long long.
This is to avoid typedef collisions with some compile configurations. For more info, see https://blogs.oracle.com/nike/entry/ilp64_lp64_llp64 http://www.unix.org/whitepapers/64bit.html BUG=4497 Review URL: https://codereview.webrtc.org/1186093004 Cr-Commit-Position: refs/heads/master@{#9451}
This commit is contained in:
parent
6befa00b44
commit
979e0b30f1
@ -49,8 +49,8 @@ typedef int64_t int64;
|
||||
#endif
|
||||
#define INT64_F "l"
|
||||
#elif defined(__LP64__)
|
||||
typedef unsigned long uint64; // NOLINT
|
||||
typedef long int64; // NOLINT
|
||||
typedef unsigned long long uint64; // NOLINT
|
||||
typedef long long int64; // NOLINT
|
||||
#ifndef INT64_C
|
||||
#define INT64_C(x) x ## L
|
||||
#endif
|
||||
|
||||
@ -14,6 +14,15 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
static_assert(sizeof(int8) == 1, "Unexpected size");
|
||||
static_assert(sizeof(uint8) == 1, "Unexpected size");
|
||||
static_assert(sizeof(int16) == 2, "Unexpected size");
|
||||
static_assert(sizeof(uint16) == 2, "Unexpected size");
|
||||
static_assert(sizeof(int32) == 4, "Unexpected size");
|
||||
static_assert(sizeof(uint32) == 4, "Unexpected size");
|
||||
static_assert(sizeof(int64) == 8, "Unexpected size");
|
||||
static_assert(sizeof(uint64) == 8, "Unexpected size");
|
||||
|
||||
TEST(BasicTypesTest, Endian) {
|
||||
uint16 v16 = 0x1234u;
|
||||
uint8 first_byte = *reinterpret_cast<uint8*>(&v16);
|
||||
|
||||
@ -17,13 +17,19 @@
|
||||
#if defined(SSL_USE_OPENSSL)
|
||||
#include <openssl/rand.h>
|
||||
#elif defined(SSL_USE_NSS_RNG)
|
||||
// Hack: Define+undefine int64 and uint64 to avoid typedef conflict with NSS.
|
||||
// TODO(kjellander): Remove when webrtc:4497 is completed.
|
||||
#define uint64 foo_uint64
|
||||
#define int64 foo_int64
|
||||
#include "pk11func.h"
|
||||
#undef uint64
|
||||
#undef int64
|
||||
#else
|
||||
#if defined(WEBRTC_WIN)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <ntsecapi.h>
|
||||
#endif // WEBRTC_WIN
|
||||
#endif // WEBRTC_WIN
|
||||
#endif // else
|
||||
#endif // FEATURE_ENABLED_SSL
|
||||
|
||||
@ -141,7 +147,7 @@ class SecureRandomGenerator : public RandomGenerator {
|
||||
|
||||
#error No SSL implementation has been selected!
|
||||
|
||||
#endif // WEBRTC_WIN
|
||||
#endif // WEBRTC_WIN
|
||||
#endif
|
||||
|
||||
// A test random generator, for predictable output.
|
||||
|
||||
@ -13,7 +13,13 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
// Hack: Define+undefine int64 and uint64 to avoid typedef conflict with NSS.
|
||||
// TODO(kjellander): Remove when webrtc:4497 is completed.
|
||||
#define uint64 foo_uint64
|
||||
#define int64 foo_int64
|
||||
#include "cert.h"
|
||||
#undef uint64
|
||||
#undef int64
|
||||
#include "nspr.h"
|
||||
#include "hasht.h"
|
||||
#include "keythi.h"
|
||||
|
||||
@ -14,7 +14,14 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Hack: Define+undefine int64 and uint64 to avoid typedef conflict with NSS.
|
||||
// TODO(kjellander): Remove when webrtc:4497 is completed.
|
||||
#define uint64 foo_uint64
|
||||
#define int64 foo_int64
|
||||
#include "nspr.h"
|
||||
#undef uint64
|
||||
#undef int64
|
||||
|
||||
#include "nss.h"
|
||||
#include "secmodt.h"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user