OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef DOUBLE_CONVERSION_UTILS_H_ | 28 #ifndef DOUBLE_CONVERSION_UTILS_H_ |
29 #define DOUBLE_CONVERSION_UTILS_H_ | 29 #define DOUBLE_CONVERSION_UTILS_H_ |
30 | 30 |
31 #include <stdlib.h> | 31 #include <stdlib.h> |
32 #include <string.h> | 32 #include <string.h> |
33 | 33 |
34 #include <assert.h> | 34 #include <assert.h> |
35 #ifndef ASSERT | 35 #ifndef ASSERT |
36 #define ASSERT(condition) (assert(condition)) | 36 #define ASSERT(condition) \ |
| 37 do { \ |
| 38 assert(condition); \ |
| 39 } while (false && (condition)) |
37 #endif | 40 #endif |
38 #ifndef UNIMPLEMENTED | 41 #ifndef UNIMPLEMENTED |
39 #define UNIMPLEMENTED() (abort()) | 42 #define UNIMPLEMENTED() (abort()) |
40 #endif | 43 #endif |
41 #ifndef UNREACHABLE | 44 #ifndef UNREACHABLE |
42 #define UNREACHABLE() (abort()) | 45 #define UNREACHABLE() (abort()) |
43 #endif | 46 #endif |
44 | 47 |
45 // Double operations detection based on target architecture. | 48 // Double operations detection based on target architecture. |
46 // Linux uses a 80bit wide floating point stack on x86. This induces double | 49 // Linux uses a 80bit wide floating point stack on x86. This induces double |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 303 } |
301 | 304 |
302 template <class Dest, class Source> | 305 template <class Dest, class Source> |
303 inline Dest BitCast(Source* source) { | 306 inline Dest BitCast(Source* source) { |
304 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); | 307 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); |
305 } | 308 } |
306 | 309 |
307 } // namespace double_conversion | 310 } // namespace double_conversion |
308 | 311 |
309 #endif // DOUBLE_CONVERSION_UTILS_H_ | 312 #endif // DOUBLE_CONVERSION_UTILS_H_ |
OLD | NEW |