| 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_FXCRT_INCLUDE_FX_SYSTEM_H_ | 7 #ifndef CORE_FXCRT_FX_SYSTEM_H_ |
| 8 #define CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ | 8 #define CORE_FXCRT_FX_SYSTEM_H_ |
| 9 | 9 |
| 10 #include <assert.h> | 10 #include <assert.h> |
| 11 #include <math.h> | 11 #include <math.h> |
| 12 #include <stdarg.h> | 12 #include <stdarg.h> |
| 13 #include <stddef.h> | 13 #include <stddef.h> |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 #include <stdio.h> | 15 #include <stdio.h> |
| 16 #include <stdlib.h> | 16 #include <stdlib.h> |
| 17 #include <string.h> | 17 #include <string.h> |
| 18 #include <wchar.h> | 18 #include <wchar.h> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // NOTE: prevent use of the return value from snprintf() since some platforms | 117 // NOTE: prevent use of the return value from snprintf() since some platforms |
| 118 // have different return values (e.g. windows _vsnprintf()), and provide | 118 // have different return values (e.g. windows _vsnprintf()), and provide |
| 119 // versions that always NUL-terminate. | 119 // versions that always NUL-terminate. |
| 120 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 | 120 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 |
| 121 void FXSYS_snprintf(char* str, | 121 void FXSYS_snprintf(char* str, |
| 122 size_t size, | 122 size_t size, |
| 123 _Printf_format_string_ const char* fmt, | 123 _Printf_format_string_ const char* fmt, |
| 124 ...); | 124 ...); |
| 125 void FXSYS_vsnprintf(char* str, size_t size, const char* fmt, va_list ap); | 125 void FXSYS_vsnprintf(char* str, size_t size, const char* fmt, va_list ap); |
| 126 #else | 126 #else |
| 127 #define FXSYS_snprintf (void) snprintf | 127 #define FXSYS_snprintf (void)snprintf |
| 128 #define FXSYS_vsnprintf (void) vsnprintf | 128 #define FXSYS_vsnprintf (void)vsnprintf |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 #define FXSYS_sprintf DO_NOT_USE_SPRINTF_DIE_DIE_DIE | 131 #define FXSYS_sprintf DO_NOT_USE_SPRINTF_DIE_DIE_DIE |
| 132 #define FXSYS_vsprintf DO_NOT_USE_VSPRINTF_DIE_DIE_DIE | 132 #define FXSYS_vsprintf DO_NOT_USE_VSPRINTF_DIE_DIE_DIE |
| 133 #define FXSYS_strncmp strncmp | 133 #define FXSYS_strncmp strncmp |
| 134 #define FXSYS_strcmp strcmp | 134 #define FXSYS_strcmp strcmp |
| 135 #define FXSYS_strcpy strcpy | 135 #define FXSYS_strcpy strcpy |
| 136 #define FXSYS_strncpy strncpy | 136 #define FXSYS_strncpy strncpy |
| 137 #define FXSYS_strstr strstr | 137 #define FXSYS_strstr strstr |
| 138 #define FXSYS_FILE FILE | 138 #define FXSYS_FILE FILE |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 332 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
| 333 | 333 |
| 334 // Prevent a function from ever being inlined, typically because we'd | 334 // Prevent a function from ever being inlined, typically because we'd |
| 335 // like it to appear in stack traces. | 335 // like it to appear in stack traces. |
| 336 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 336 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 337 #define NEVER_INLINE __declspec(noinline) | 337 #define NEVER_INLINE __declspec(noinline) |
| 338 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 338 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 339 #define NEVER_INLINE __attribute__((__noinline__)) | 339 #define NEVER_INLINE __attribute__((__noinline__)) |
| 340 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 340 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 341 | 341 |
| 342 #endif // CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ | 342 #endif // CORE_FXCRT_FX_SYSTEM_H_ |
| OLD | NEW |