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