summaryrefslogtreecommitdiff
path: root/xfa/include/fwl/core/fwl_error.h
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/include/fwl/core/fwl_error.h')
-rw-r--r--xfa/include/fwl/core/fwl_error.h105
1 files changed, 68 insertions, 37 deletions
diff --git a/xfa/include/fwl/core/fwl_error.h b/xfa/include/fwl/core/fwl_error.h
index 465808a116..4c0f3b96e7 100644
--- a/xfa/include/fwl/core/fwl_error.h
+++ b/xfa/include/fwl/core/fwl_error.h
@@ -6,45 +6,76 @@
#ifndef _FWL_ERROR_H
#define _FWL_ERROR_H
-typedef int32_t FWL_ERR;
-#define FWL_ERR_Succeeded 0
-#define FWL_ERR_Indefinite -1
-#define FWL_ERR_Parameter_Invalid -100
-#define FWL_ERR_Property_Invalid -200
-#define FWL_ERR_Intermediate_Value__Invalid -300
-#define FWL_ERR_Method_Not_Supported -400
-#define FWL_ERR_Out_Of_Memory -500
-#if defined (__WIN32__) || defined (_WIN32)
-#define _FWL_ALARM_IF_FAIL(arg, alarm) { if (!(arg)) ::OutputDebugString(alarm); }
-#elif defined (__linux) || defined (linux) || defined (__APPLE__) || defined (__MACOSX__)
-#define _FWL_ALARM_IF_FAIL(arg, alarm) { if (!(arg)) printf(alarm); }
+typedef int32_t FWL_ERR;
+#define FWL_ERR_Succeeded 0
+#define FWL_ERR_Indefinite -1
+#define FWL_ERR_Parameter_Invalid -100
+#define FWL_ERR_Property_Invalid -200
+#define FWL_ERR_Intermediate_Value__Invalid -300
+#define FWL_ERR_Method_Not_Supported -400
+#define FWL_ERR_Out_Of_Memory -500
+#if defined(__WIN32__) || defined(_WIN32)
+#define _FWL_ALARM_IF_FAIL(arg, alarm) \
+ { \
+ if (!(arg)) \
+ ::OutputDebugString(alarm); \
+ }
+#elif defined(__linux) || defined(linux) || defined(__APPLE__) || \
+ defined(__MACOSX__)
+#define _FWL_ALARM_IF_FAIL(arg, alarm) \
+ { \
+ if (!(arg)) \
+ printf(alarm); \
+ }
#else
#endif
-#define _FWL_RETURN_IF_FAIL(arg) { if (!(arg)) return; }
-#define _FWL_RETURN_VALUE_IF_FAIL(arg, val) { if (!(arg)) return val; }
-#define _FWL_GOTO_POSITION_IF_FAIL(arg, pos) { if (!(arg)) goto pos; }
-#if defined (__WIN32__) || defined (_WIN32)
-#define \
- _FWL_ERR_CHECK_ALARM_IF_FAIL(arg) \
- { \
- if ((arg) != FWL_ERR_Succeeded) \
- { \
- char buf[36]; \
- memset(buf, 0, sizeof(buf)); \
- FXSYS_snprintf(buf, sizeof(buf) - 1, "Error code is %d\n", arg); \
- ::OutputDebugString(buf); \
- } \
- }
-#elif defined (__linux) || defined (linux) || defined (__APPLE__) || defined (__MACOSX__)
-#define \
- _FWL_ERR_CHECK_ALARM_IF_FAIL(arg) \
- { \
- if ((arg) != FWL_ERR_Succeeded) \
- printf("%d\n", arg); \
- }
+#define _FWL_RETURN_IF_FAIL(arg) \
+ { \
+ if (!(arg)) \
+ return; \
+ }
+#define _FWL_RETURN_VALUE_IF_FAIL(arg, val) \
+ { \
+ if (!(arg)) \
+ return val; \
+ }
+#define _FWL_GOTO_POSITION_IF_FAIL(arg, pos) \
+ { \
+ if (!(arg)) \
+ goto pos; \
+ }
+#if defined(__WIN32__) || defined(_WIN32)
+#define _FWL_ERR_CHECK_ALARM_IF_FAIL(arg) \
+ { \
+ if ((arg) != FWL_ERR_Succeeded) { \
+ char buf[36]; \
+ memset(buf, 0, sizeof(buf)); \
+ FXSYS_snprintf(buf, sizeof(buf) - 1, "Error code is %d\n", arg); \
+ ::OutputDebugString(buf); \
+ } \
+ }
+#elif defined(__linux) || defined(linux) || defined(__APPLE__) || \
+ defined(__MACOSX__)
+#define _FWL_ERR_CHECK_ALARM_IF_FAIL(arg) \
+ { \
+ if ((arg) != FWL_ERR_Succeeded) \
+ printf("%d\n", arg); \
+ }
#else
#endif
-#define _FWL_ERR_CHECK_RETURN_IF_FAIL(arg) { if ((arg) != FWL_ERR_Succeeded) return; }
-#define _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(arg, val) { if ((arg) != FWL_ERR_Succeeded) return val; }
-#define _FWL_ERR_CHECK_GOTO_POSITION_IF_FAIL(arg, pos) { if ((arg) != FWL_ERR_Succeeded) goto pos; }
+#define _FWL_ERR_CHECK_RETURN_IF_FAIL(arg) \
+ { \
+ if ((arg) != FWL_ERR_Succeeded) \
+ return; \
+ }
+#define _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(arg, val) \
+ { \
+ if ((arg) != FWL_ERR_Succeeded) \
+ return val; \
+ }
+#define _FWL_ERR_CHECK_GOTO_POSITION_IF_FAIL(arg, pos) \
+ { \
+ if ((arg) != FWL_ERR_Succeeded) \
+ goto pos; \
+ }
#endif