| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ | 7 #ifndef CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ |
| 8 #define CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ | 8 #define CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ |
| 9 | 9 |
| 10 #include <assert.h> | 10 #include <assert.h> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #endif | 96 #endif |
| 97 | 97 |
| 98 #ifndef ASSERT | 98 #ifndef ASSERT |
| 99 #ifndef NDEBUG | 99 #ifndef NDEBUG |
| 100 #define ASSERT assert | 100 #define ASSERT assert |
| 101 #else | 101 #else |
| 102 #define ASSERT(a) | 102 #define ASSERT(a) |
| 103 #endif | 103 #endif |
| 104 #endif | 104 #endif |
| 105 | 105 |
| 106 #if defined(__clang__) || defined(__GNUC__) |
| 107 #define PDFIUM_IMMEDIATE_CRASH() __builtin_trap() |
| 108 #else |
| 109 #define PDFIUM_IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0)) |
| 110 #endif |
| 111 |
| 106 // M_PI not universally present on all platforms. | 112 // M_PI not universally present on all platforms. |
| 107 #define FX_PI 3.1415926535897932384626433832795f | 113 #define FX_PI 3.1415926535897932384626433832795f |
| 108 #define FX_BEZIER 0.5522847498308f | 114 #define FX_BEZIER 0.5522847498308f |
| 109 | 115 |
| 110 // NOTE: prevent use of the return value from snprintf() since some platforms | 116 // NOTE: prevent use of the return value from snprintf() since some platforms |
| 111 // have different return values (e.g. windows _vsnprintf()), and provide | 117 // have different return values (e.g. windows _vsnprintf()), and provide |
| 112 // versions that always NUL-terminate. | 118 // versions that always NUL-terminate. |
| 113 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 | 119 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 |
| 114 void FXSYS_snprintf(char* str, | 120 void FXSYS_snprintf(char* str, |
| 115 size_t size, | 121 size_t size, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 332 |
| 327 // Prevent a function from ever being inlined, typically because we'd | 333 // Prevent a function from ever being inlined, typically because we'd |
| 328 // like it to appear in stack traces. | 334 // like it to appear in stack traces. |
| 329 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 335 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 330 #define NEVER_INLINE __declspec(noinline) | 336 #define NEVER_INLINE __declspec(noinline) |
| 331 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 337 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 332 #define NEVER_INLINE __attribute__((__noinline__)) | 338 #define NEVER_INLINE __attribute__((__noinline__)) |
| 333 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 339 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 334 | 340 |
| 335 #endif // CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ | 341 #endif // CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ |
| OLD | NEW |