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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 typedef double FX_DOUBLE; // Keep, allow downgrade to floats. | 74 typedef double FX_DOUBLE; // Keep, allow downgrade to floats. |
75 typedef int FX_BOOL; // Keep, sadly not always 0 or 1. | 75 typedef int FX_BOOL; // Keep, sadly not always 0 or 1. |
76 typedef char FX_CHAR; // Keep, questionable signedness. | 76 typedef char FX_CHAR; // Keep, questionable signedness. |
77 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. | 77 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. |
78 | 78 |
79 // PDFium string sizes are limited to 2^31-1, and the value is signed to | 79 // PDFium string sizes are limited to 2^31-1, and the value is signed to |
80 // allow -1 as a placeholder for "unknown". | 80 // allow -1 as a placeholder for "unknown". |
81 // TODO(palmer): it should be a |size_t|, or at least unsigned. | 81 // TODO(palmer): it should be a |size_t|, or at least unsigned. |
82 typedef int FX_STRSIZE; | 82 typedef int FX_STRSIZE; |
83 | 83 |
84 #if defined(DEBUG) && !defined(_DEBUG) | |
85 #define _DEBUG | |
86 #endif | |
87 | |
88 #ifndef TRUE | 84 #ifndef TRUE |
89 #define TRUE 1 | 85 #define TRUE 1 |
90 #endif | 86 #endif |
91 | 87 |
92 #ifndef FALSE | 88 #ifndef FALSE |
93 #define FALSE 0 | 89 #define FALSE 0 |
94 #endif | 90 #endif |
95 | 91 |
96 #ifdef __cplusplus | 92 #ifdef __cplusplus |
97 static_assert(TRUE == true, "true_needs_to_be_true"); | 93 static_assert(TRUE == true, "true_needs_to_be_true"); |
98 static_assert(FALSE == false, "false_needs_to_be_false"); | 94 static_assert(FALSE == false, "false_needs_to_be_false"); |
99 #endif | 95 #endif |
100 | 96 |
101 #ifndef NULL | 97 #ifndef NULL |
102 #define NULL 0 | 98 #define NULL 0 |
103 #endif | 99 #endif |
104 | 100 |
105 #define FXSYS_assert assert | 101 #define FXSYS_assert assert |
106 #ifndef ASSERT | 102 #ifndef ASSERT |
107 #ifdef _DEBUG | 103 #ifndef NDEBUG |
108 #define ASSERT FXSYS_assert | 104 #define ASSERT FXSYS_assert |
109 #else | 105 #else |
110 #define ASSERT(a) | 106 #define ASSERT(a) |
111 #endif | 107 #endif |
112 #endif | 108 #endif |
113 | 109 |
114 // M_PI not universally present on all platforms. | 110 // M_PI not universally present on all platforms. |
115 #define FX_PI 3.1415926535897932384626433832795f | 111 #define FX_PI 3.1415926535897932384626433832795f |
116 #define FX_BEZIER 0.5522847498308f | 112 #define FX_BEZIER 0.5522847498308f |
117 | 113 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 309 |
314 // Prevent a function from ever being inlined, typically because we'd | 310 // Prevent a function from ever being inlined, typically because we'd |
315 // like it to appear in stack traces. | 311 // like it to appear in stack traces. |
316 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 312 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
317 #define NEVER_INLINE __declspec(noinline) | 313 #define NEVER_INLINE __declspec(noinline) |
318 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 314 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
319 #define NEVER_INLINE __attribute__((__noinline__)) | 315 #define NEVER_INLINE __attribute__((__noinline__)) |
320 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 316 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
321 | 317 |
322 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 318 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |