Merge changes Iee0932b5,I0d77c490
* changes: Fix Errors.h on systems that define NO_ERROR Disable call stacks on every OS except Linux/Android
This commit is contained in:
commit
f8cd69af8b
2 changed files with 5 additions and 13 deletions
|
|
@ -50,7 +50,7 @@
|
||||||
// log all reference counting operations
|
// log all reference counting operations
|
||||||
#define PRINT_REFS 0
|
#define PRINT_REFS 0
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
#if defined(__linux__)
|
||||||
// CallStack is only supported on linux type platforms.
|
// CallStack is only supported on linux type platforms.
|
||||||
#define CALLSTACK_ENABLED 1
|
#define CALLSTACK_ENABLED 1
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -34,15 +34,13 @@ typedef int32_t status_t;
|
||||||
* All error codes are negative values.
|
* 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 {
|
enum {
|
||||||
OK = 0, // Preferred constant for checking success.
|
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.
|
NO_ERROR = OK, // Deprecated synonym for `OK`. Prefer `OK` because it doesn't conflict with Windows.
|
||||||
|
#endif
|
||||||
|
|
||||||
UNKNOWN_ERROR = (-2147483647-1), // INT32_MIN value
|
UNKNOWN_ERROR = (-2147483647-1), // INT32_MIN value
|
||||||
|
|
||||||
|
|
@ -76,10 +74,4 @@ enum {
|
||||||
// Human readable name of error
|
// Human readable name of error
|
||||||
std::string statusToString(status_t status);
|
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
|
} // namespace android
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue