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_INCLUDE_FXCRT_FX_SYSTEM_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
8 #define CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
9 | 9 |
10 #include <assert.h> | 10 #include <assert.h> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 #define FXSYS_assert assert | 104 #define FXSYS_assert assert |
105 #ifndef ASSERT | 105 #ifndef ASSERT |
106 #ifdef _DEBUG | 106 #ifdef _DEBUG |
107 #define ASSERT FXSYS_assert | 107 #define ASSERT FXSYS_assert |
108 #else | 108 #else |
109 #define ASSERT(a) | 109 #define ASSERT(a) |
110 #endif | 110 #endif |
111 #endif | 111 #endif |
112 | 112 |
113 #define FX_MIN(a, b) (((a) < (b)) ? (a) : (b)) | |
114 #define FX_PI 3.1415926535897932384626433832795f | 113 #define FX_PI 3.1415926535897932384626433832795f |
115 | 114 |
116 // NOTE: prevent use of the return value from snprintf() since some platforms | 115 // NOTE: prevent use of the return value from snprintf() since some platforms |
117 // have different return values (e.g. windows _vsnprintf()), and provide | 116 // have different return values (e.g. windows _vsnprintf()), and provide |
118 // versions that always NUL-terminate. | 117 // versions that always NUL-terminate. |
119 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 | 118 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 |
120 void FXSYS_snprintf(char* str, | 119 void FXSYS_snprintf(char* str, |
121 size_t size, | 120 size_t size, |
122 _Printf_format_string_ const char* fmt, | 121 _Printf_format_string_ const char* fmt, |
123 ...); | 122 ...); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 310 |
312 // Prevent a function from ever being inlined, typically because we'd | 311 // Prevent a function from ever being inlined, typically because we'd |
313 // like it to appear in stack traces. | 312 // like it to appear in stack traces. |
314 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 313 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
315 #define NEVER_INLINE __declspec(noinline) | 314 #define NEVER_INLINE __declspec(noinline) |
316 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 315 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
317 #define NEVER_INLINE __attribute__((__noinline__)) | 316 #define NEVER_INLINE __attribute__((__noinline__)) |
318 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 317 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
319 | 318 |
320 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 319 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |