OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/base/helpers.h" | 11 #include "webrtc/base/helpers.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 | 14 |
15 #if defined(FEATURE_ENABLE_SSL) | 15 #if defined(FEATURE_ENABLE_SSL) |
16 #include "webrtc/base/sslconfig.h" | 16 #include "webrtc/base/sslconfig.h" |
17 #if defined(SSL_USE_OPENSSL) | 17 #if defined(SSL_USE_OPENSSL) |
18 #include <openssl/rand.h> | 18 #include <openssl/rand.h> |
19 #elif defined(SSL_USE_NSS_RNG) | |
20 // Hack: Define+undefine int64 and uint64 to avoid typedef conflict with NSS. | |
21 // TODO(kjellander): Remove when webrtc:4497 is completed. | |
22 #define uint64 foo_uint64 | |
23 #define int64 foo_int64 | |
24 #include "pk11func.h" | |
25 #undef uint64 | |
26 #undef int64 | |
27 #else | 19 #else |
28 #if defined(WEBRTC_WIN) | 20 #if defined(WEBRTC_WIN) |
29 #define WIN32_LEAN_AND_MEAN | 21 #define WIN32_LEAN_AND_MEAN |
30 #include <windows.h> | 22 #include <windows.h> |
31 #include <ntsecapi.h> | 23 #include <ntsecapi.h> |
32 #endif // WEBRTC_WIN | 24 #endif // WEBRTC_WIN |
33 #endif // else | 25 #endif // else |
34 #endif // FEATURE_ENABLED_SSL | 26 #endif // FEATURE_ENABLED_SSL |
35 | 27 |
36 #include "webrtc/base/base64.h" | 28 #include "webrtc/base/base64.h" |
(...skipping 231 matching lines...) Loading... |
268 } while (id == 0); | 260 } while (id == 0); |
269 return id; | 261 return id; |
270 } | 262 } |
271 | 263 |
272 double CreateRandomDouble() { | 264 double CreateRandomDouble() { |
273 return CreateRandomId() / (std::numeric_limits<uint32>::max() + | 265 return CreateRandomId() / (std::numeric_limits<uint32>::max() + |
274 std::numeric_limits<double>::epsilon()); | 266 std::numeric_limits<double>::epsilon()); |
275 } | 267 } |
276 | 268 |
277 } // namespace rtc | 269 } // namespace rtc |
OLD | NEW |