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 _FWL_ERROR_H | 7 #ifndef XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ |
8 #define _FWL_ERROR_H | 8 #define XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ |
| 9 |
| 10 #include <stdint.h> |
| 11 |
9 typedef int32_t FWL_ERR; | 12 typedef int32_t FWL_ERR; |
| 13 |
10 #define FWL_ERR_Succeeded 0 | 14 #define FWL_ERR_Succeeded 0 |
11 #define FWL_ERR_Indefinite -1 | 15 #define FWL_ERR_Indefinite -1 |
12 #define FWL_ERR_Parameter_Invalid -100 | 16 #define FWL_ERR_Parameter_Invalid -100 |
13 #define FWL_ERR_Property_Invalid -200 | 17 #define FWL_ERR_Property_Invalid -200 |
14 #define FWL_ERR_Intermediate_Value__Invalid -300 | 18 #define FWL_ERR_Intermediate_Value__Invalid -300 |
15 #define FWL_ERR_Method_Not_Supported -400 | 19 #define FWL_ERR_Method_Not_Supported -400 |
16 #define FWL_ERR_Out_Of_Memory -500 | 20 #define FWL_ERR_Out_Of_Memory -500 |
| 21 |
17 #if defined(__WIN32__) || defined(_WIN32) | 22 #if defined(__WIN32__) || defined(_WIN32) |
18 #define _FWL_ALARM_IF_FAIL(arg, alarm) \ | 23 #define _FWL_ALARM_IF_FAIL(arg, alarm) \ |
19 { \ | 24 { \ |
20 if (!(arg)) \ | 25 if (!(arg)) \ |
21 ::OutputDebugString(alarm); \ | 26 ::OutputDebugString(alarm); \ |
22 } | 27 } |
23 #elif defined(__linux) || defined(linux) || defined(__APPLE__) || \ | 28 #elif defined(__linux) || defined(linux) || defined(__APPLE__) || \ |
24 defined(__MACOSX__) | 29 defined(__MACOSX__) |
25 #define _FWL_ALARM_IF_FAIL(arg, alarm) \ | 30 #define _FWL_ALARM_IF_FAIL(arg, alarm) \ |
26 { \ | 31 { \ |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #define _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(arg, val) \ | 76 #define _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(arg, val) \ |
72 { \ | 77 { \ |
73 if ((arg) != FWL_ERR_Succeeded) \ | 78 if ((arg) != FWL_ERR_Succeeded) \ |
74 return val; \ | 79 return val; \ |
75 } | 80 } |
76 #define _FWL_ERR_CHECK_GOTO_POSITION_IF_FAIL(arg, pos) \ | 81 #define _FWL_ERR_CHECK_GOTO_POSITION_IF_FAIL(arg, pos) \ |
77 { \ | 82 { \ |
78 if ((arg) != FWL_ERR_Succeeded) \ | 83 if ((arg) != FWL_ERR_Succeeded) \ |
79 goto pos; \ | 84 goto pos; \ |
80 } | 85 } |
81 #endif | 86 |
| 87 #endif // XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ |
OLD | NEW |