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