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_Mul(a, b) ((a) * (b)) | |
273 #define FXSYS_Div(a, b) ((a) / (b)) | 272 #define FXSYS_Div(a, b) ((a) / (b)) |
274 #define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c)) | 273 #define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c)) |
275 #define FXSYS_sqrt2(a, b) (FX_FLOAT) FXSYS_sqrt((a) * (a) + (b) * (b)) | 274 #define FXSYS_sqrt2(a, b) (FX_FLOAT) FXSYS_sqrt((a) * (a) + (b) * (b)) |
276 #ifdef __cplusplus | 275 #ifdef __cplusplus |
277 }; | 276 }; |
278 #endif | 277 #endif |
279 | 278 |
280 // To print a size_t value in a portable way: | 279 // To print a size_t value in a portable way: |
281 // size_t size; | 280 // size_t size; |
282 // printf("xyz: %" PRIuS, size); | 281 // printf("xyz: %" PRIuS, size); |
(...skipping 26 matching lines...) Expand all Loading... |
309 | 308 |
310 // Prevent a function from ever being inlined, typically because we'd | 309 // Prevent a function from ever being inlined, typically because we'd |
311 // like it to appear in stack traces. | 310 // like it to appear in stack traces. |
312 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 311 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
313 #define NEVER_INLINE __declspec(noinline) | 312 #define NEVER_INLINE __declspec(noinline) |
314 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 313 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
315 #define NEVER_INLINE __attribute__((__noinline__)) | 314 #define NEVER_INLINE __attribute__((__noinline__)) |
316 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 315 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
317 | 316 |
318 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ | 317 #endif // CORE_INCLUDE_FXCRT_FX_SYSTEM_H_ |
OLD | NEW |