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 |
19 #else | 27 #else |
20 #if defined(WEBRTC_WIN) | 28 #if defined(WEBRTC_WIN) |
21 #define WIN32_LEAN_AND_MEAN | 29 #define WIN32_LEAN_AND_MEAN |
22 #include <windows.h> | 30 #include <windows.h> |
23 #include <ntsecapi.h> | 31 #include <ntsecapi.h> |
24 #endif // WEBRTC_WIN | 32 #endif // WEBRTC_WIN |
25 #endif // else | 33 #endif // else |
26 #endif // FEATURE_ENABLED_SSL | 34 #endif // FEATURE_ENABLED_SSL |
27 | 35 |
28 #include "webrtc/base/base64.h" | 36 #include "webrtc/base/base64.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } while (id == 0); | 268 } while (id == 0); |
261 return id; | 269 return id; |
262 } | 270 } |
263 | 271 |
264 double CreateRandomDouble() { | 272 double CreateRandomDouble() { |
265 return CreateRandomId() / (std::numeric_limits<uint32>::max() + | 273 return CreateRandomId() / (std::numeric_limits<uint32>::max() + |
266 std::numeric_limits<double>::epsilon()); | 274 std::numeric_limits<double>::epsilon()); |
267 } | 275 } |
268 | 276 |
269 } // namespace rtc | 277 } // namespace rtc |
OLD | NEW |