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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 #define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8)) | 262 #define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8)) |
263 #define FXSYS_LOBYTE(word) ((uint8_t)(word)) | 263 #define FXSYS_LOBYTE(word) ((uint8_t)(word)) |
264 #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) | 264 #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) |
265 #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) | 265 #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) |
266 int32_t FXSYS_atoi(const FX_CHAR* str); | 266 int32_t FXSYS_atoi(const FX_CHAR* str); |
267 int32_t FXSYS_wtoi(const FX_WCHAR* str); | 267 int32_t FXSYS_wtoi(const FX_WCHAR* str); |
268 int64_t FXSYS_atoi64(const FX_CHAR* str); | 268 int64_t FXSYS_atoi64(const FX_CHAR* str); |
269 int64_t FXSYS_wtoi64(const FX_WCHAR* str); | 269 int64_t FXSYS_wtoi64(const FX_WCHAR* str); |
270 const FX_CHAR* FXSYS_i64toa(int64_t value, FX_CHAR* str, int radix); | 270 const FX_CHAR* FXSYS_i64toa(int64_t value, FX_CHAR* str, int radix); |
271 int FXSYS_round(FX_FLOAT f); | 271 int FXSYS_round(FX_FLOAT f); |
272 #define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c)) | |
273 #define FXSYS_sqrt2(a, b) (FX_FLOAT) FXSYS_sqrt((a) * (a) + (b) * (b)) | 272 #define FXSYS_sqrt2(a, b) (FX_FLOAT) FXSYS_sqrt((a) * (a) + (b) * (b)) |
Tom Sepez
2016/02/23 23:40:12
Nit: Let's someday make this a function rather tha
| |
274 #ifdef __cplusplus | 273 #ifdef __cplusplus |
275 }; | 274 }; |
276 #endif | 275 #endif |
277 | 276 |
278 // To print a size_t value in a portable way: | 277 // To print a size_t value in a portable way: |
279 // size_t size; | 278 // size_t size; |
280 // printf("xyz: %" PRIuS, size); | 279 // printf("xyz: %" PRIuS, size); |
281 // The "u" in the macro corresponds to %u, and S is for "size". | 280 // The "u" in the macro corresponds to %u, and S is for "size". |
282 | 281 |
283 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 282 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
(...skipping 23 matching lines...) Expand all Loading... | |
307 | 306 |
308 // Prevent a function from ever being inlined, typically because we'd | 307 // Prevent a function from ever being inlined, typically because we'd |
309 // like it to appear in stack traces. | 308 // like it to appear in stack traces. |
310 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 309 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
311 #define NEVER_INLINE __declspec(noinline) | 310 #define NEVER_INLINE __declspec(noinline) |
312 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 311 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
313 #define NEVER_INLINE __attribute__((__noinline__)) | 312 #define NEVER_INLINE __attribute__((__noinline__)) |
314 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 313 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
315 | 314 |
316 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 315 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |