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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include <Carbon/Carbon.h> | 64 #include <Carbon/Carbon.h> |
65 #endif | 65 #endif |
66 | 66 |
67 #ifdef __cplusplus | 67 #ifdef __cplusplus |
68 extern "C" { | 68 extern "C" { |
69 #endif | 69 #endif |
70 typedef void* FX_POSITION; // Keep until fxcrt containers gone | 70 typedef void* FX_POSITION; // Keep until fxcrt containers gone |
71 typedef unsigned short FX_WORD; // Keep - "an efficient small type" | 71 typedef unsigned short FX_WORD; // Keep - "an efficient small type" |
72 typedef unsigned int FX_DWORD; // Keep - "an efficient type" | 72 typedef unsigned int FX_DWORD; // Keep - "an efficient type" |
73 typedef float FX_FLOAT; // Keep, allow upgrade to doubles. | 73 typedef float FX_FLOAT; // Keep, allow upgrade to doubles. |
| 74 typedef int FX_BOOL; // Keep, sadly not always 0 or 1. |
74 typedef char FX_CHAR; // Keep, questionable signedness. | 75 typedef char FX_CHAR; // Keep, questionable signedness. |
75 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. | 76 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. |
76 | 77 |
77 // PDFium string sizes are limited to 2^31-1, and the value is signed to | 78 // PDFium string sizes are limited to 2^31-1, and the value is signed to |
78 // allow -1 as a placeholder for "unknown". | 79 // allow -1 as a placeholder for "unknown". |
79 // TODO(palmer): it should be a |size_t|, or at least unsigned. | 80 // TODO(palmer): it should be a |size_t|, or at least unsigned. |
80 typedef int FX_STRSIZE; | 81 typedef int FX_STRSIZE; |
81 | 82 |
82 #if defined(DEBUG) && !defined(_DEBUG) | 83 #if defined(DEBUG) && !defined(_DEBUG) |
83 #define _DEBUG | 84 #define _DEBUG |
84 #endif | 85 #endif |
85 | 86 |
| 87 #ifndef TRUE |
| 88 #define TRUE 1 |
| 89 #endif |
| 90 |
| 91 #ifndef FALSE |
| 92 #define FALSE 0 |
| 93 #endif |
| 94 |
86 #ifndef NULL | 95 #ifndef NULL |
87 #define NULL 0 | 96 #define NULL 0 |
88 #endif | 97 #endif |
89 | 98 |
90 #define FXSYS_assert assert | 99 #define FXSYS_assert assert |
91 #ifndef ASSERT | 100 #ifndef ASSERT |
92 #ifdef _DEBUG | 101 #ifdef _DEBUG |
93 #define ASSERT FXSYS_assert | 102 #define ASSERT FXSYS_assert |
94 #else | 103 #else |
95 #define ASSERT(a) | 104 #define ASSERT(a) |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 286 |
278 // Prevent a function from ever being inlined, typically because we'd | 287 // Prevent a function from ever being inlined, typically because we'd |
279 // like it to appear in stack traces. | 288 // like it to appear in stack traces. |
280 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 289 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
281 #define NEVER_INLINE __declspec(noinline) | 290 #define NEVER_INLINE __declspec(noinline) |
282 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 291 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
283 #define NEVER_INLINE __attribute__((__noinline__)) | 292 #define NEVER_INLINE __attribute__((__noinline__)) |
284 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 293 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
285 | 294 |
286 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 295 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |