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_FX_SYSTEM_H_ | 7 #ifndef CORE_FXCRT_FX_SYSTEM_H_ |
8 #define CORE_FXCRT_FX_SYSTEM_H_ | 8 #define CORE_FXCRT_FX_SYSTEM_H_ |
9 | 9 |
10 #include <assert.h> | 10 #include <assert.h> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 | 69 |
70 typedef void* FX_POSITION; // Keep until fxcrt containers gone | 70 typedef void* FX_POSITION; // Keep until fxcrt containers gone |
71 typedef float FX_FLOAT; // Keep, allow upgrade to doubles. | 71 typedef float FX_FLOAT; // Keep, allow upgrade to doubles. |
72 typedef double FX_DOUBLE; // Keep, allow downgrade to floats. | 72 typedef double FX_DOUBLE; // Keep, allow downgrade to floats. |
73 typedef char FX_CHAR; // Keep, questionable signedness. | 73 typedef char FX_CHAR; // Keep, questionable signedness. |
74 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. | 74 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. |
75 | 75 |
76 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) | 76 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) |
77 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) | 77 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) |
78 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) | 78 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) |
79 #define IsFloatEqual(fa, fb) IsFloatZero(fa - fb) | 79 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) |
dsinclair
2016/11/09 03:33:23
Should these just be real methods instead of macro
Lei Zhang
2016/11/09 05:34:09
We can, but the behavior of this CL won't change f
| |
80 | 80 |
81 // PDFium string sizes are limited to 2^31-1, and the value is signed to | 81 // PDFium string sizes are limited to 2^31-1, and the value is signed to |
82 // allow -1 as a placeholder for "unknown". | 82 // allow -1 as a placeholder for "unknown". |
83 // TODO(palmer): it should be a |size_t|, or at least unsigned. | 83 // TODO(palmer): it should be a |size_t|, or at least unsigned. |
84 typedef int FX_STRSIZE; | 84 typedef int FX_STRSIZE; |
85 | 85 |
86 #ifndef ASSERT | 86 #ifndef ASSERT |
87 #ifndef NDEBUG | 87 #ifndef NDEBUG |
88 #define ASSERT assert | 88 #define ASSERT assert |
89 #else | 89 #else |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 | 320 |
321 // Prevent a function from ever being inlined, typically because we'd | 321 // Prevent a function from ever being inlined, typically because we'd |
322 // like it to appear in stack traces. | 322 // like it to appear in stack traces. |
323 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 323 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
324 #define NEVER_INLINE __declspec(noinline) | 324 #define NEVER_INLINE __declspec(noinline) |
325 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 325 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
326 #define NEVER_INLINE __attribute__((__noinline__)) | 326 #define NEVER_INLINE __attribute__((__noinline__)) |
327 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 327 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
328 | 328 |
329 #endif // CORE_FXCRT_FX_SYSTEM_H_ | 329 #endif // CORE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |