summaryrefslogtreecommitdiff
path: root/libutils/include/utils/Errors.h
diff options
context:
space:
mode:
Diffstat (limited to 'libutils/include/utils/Errors.h')
-rw-r--r--libutils/include/utils/Errors.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/libutils/include/utils/Errors.h b/libutils/include/utils/Errors.h
index 22fb36d25..d14d2231d 100644
--- a/libutils/include/utils/Errors.h
+++ b/libutils/include/utils/Errors.h
@@ -34,13 +34,15 @@ typedef int32_t status_t;
* All error codes are negative values.
*/
+// Win32 #defines NO_ERROR as well. It has the same value, so there's no
+// real conflict, though it's a bit awkward.
+#ifdef _WIN32
+# undef NO_ERROR
+#endif
+
enum {
OK = 0, // Preferred constant for checking success.
-#ifndef NO_ERROR
- // Win32 #defines NO_ERROR as well. It has the same value, so there's no
- // real conflict, though it's a bit awkward.
NO_ERROR = OK, // Deprecated synonym for `OK`. Prefer `OK` because it doesn't conflict with Windows.
-#endif
UNKNOWN_ERROR = (-2147483647-1), // INT32_MIN value
@@ -74,4 +76,10 @@ enum {
// Human readable name of error
std::string statusToString(status_t status);
+// Restore define; enumeration is in "android" namespace, so the value defined
+// there won't work for Win32 code in a different namespace.
+#ifdef _WIN32
+# define NO_ERROR 0L
+#endif
+
} // namespace android