OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // The purpose of this file is to supply the macro definintions necessary | 5 // The purpose of this file is to supply the macro definintions necessary |
6 // to make third_party/dmg_fp/dtoa.cc threadsafe. | 6 // to make third_party/dmg_fp/dtoa.cc threadsafe. |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 base::Lock* lock = n == 0 ? dtoa_lock_0.Pointer() : dtoa_lock_1.Pointer(); | 36 base::Lock* lock = n == 0 ? dtoa_lock_0.Pointer() : dtoa_lock_1.Pointer(); |
37 lock->Acquire(); | 37 lock->Acquire(); |
38 } | 38 } |
39 | 39 |
40 inline static void FREE_DTOA_LOCK(size_t n) { | 40 inline static void FREE_DTOA_LOCK(size_t n) { |
41 DCHECK(n < 2); | 41 DCHECK(n < 2); |
42 base::Lock* lock = n == 0 ? dtoa_lock_0.Pointer() : dtoa_lock_1.Pointer(); | 42 base::Lock* lock = n == 0 ? dtoa_lock_0.Pointer() : dtoa_lock_1.Pointer(); |
43 lock->Release(); | 43 lock->Release(); |
44 } | 44 } |
45 | 45 |
| 46 |
| 47 // dtoa.cc intentionally uses fallthroughs. |
| 48 #pragma clang diagnostic push |
| 49 #pragma clang diagnostic ignored "-Wimplicit-fallthrough" |
| 50 |
46 #include "base/third_party/dmg_fp/dtoa.cc" | 51 #include "base/third_party/dmg_fp/dtoa.cc" |
| 52 |
| 53 #pragma clang diagnostic pop |
OLD | NEW |