aboutsummaryrefslogtreecommitdiff
path: root/include/Common/EABase/earesult.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-08 16:45:12 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-04-08 16:45:12 +0200
commit3c534012646b0a68566a494d76fde274e29bfb9e (patch)
tree36126ee7113361e9a26c42b7fa2ee5570770081d /include/Common/EABase/earesult.h
Squashed 'EASTL/test/packages/EABase/' content from commit 9816bb9
git-subtree-dir: EASTL/test/packages/EABase git-subtree-split: 9816bb911b17f9ee593ad0913a036a175aeaece7
Diffstat (limited to 'include/Common/EABase/earesult.h')
-rw-r--r--include/Common/EABase/earesult.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/Common/EABase/earesult.h b/include/Common/EABase/earesult.h
new file mode 100644
index 0000000..d08b346
--- /dev/null
+++ b/include/Common/EABase/earesult.h
@@ -0,0 +1,62 @@
+/*-----------------------------------------------------------------------------
+ * earesult.h
+ *
+ * Copyright (c) Electronic Arts Inc. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+
+#ifndef INCLUDED_earesult_H
+#define INCLUDED_earesult_H
+
+
+#include <EABase/eabase.h>
+
+#if defined(EA_PRAGMA_ONCE_SUPPORTED)
+ #pragma once /* Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result. */
+#endif
+
+
+
+/* This result type is width-compatible with most systems. */
+typedef int32_t ea_result_type;
+
+
+namespace EA
+{
+ typedef int32_t result_type;
+
+ enum
+ {
+#ifndef SUCCESS
+ // Deprecated
+ // Note: a public MS header has created a define of this name which causes a build error. Fortunately they
+ // define it to 0 which is compatible.
+ // see: WindowsSDK\8.1.51641-fb\installed\Include\um\RasError.h
+ SUCCESS = 0,
+#endif
+ // Deprecated
+ FAILURE = -1,
+
+ // These values are now the preferred constants
+ EA_SUCCESS = 0,
+ EA_FAILURE = -1,
+ };
+}
+
+
+/* Macro to simplify testing for success. */
+#ifndef EA_SUCCEEDED
+ #define EA_SUCCEEDED(result) ((result) >= 0)
+#endif
+
+/* Macro to simplfify testing for general failure. */
+#ifndef EA_FAILED
+ #define EA_FAILED(result) ((result) < 0)
+#endif
+
+
+#endif
+
+
+
+