qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 08/15] error: New ERR_IS_* macros for checking Error**


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 08/15] error: New ERR_IS_* macros for checking Error** values
Date: Tue, 13 Jun 2017 13:53:06 -0300

Define new macros that should be used when checking errp values.
Existing methods will still work by now, but will break once we
implement IGNORE_ERRORS in a different way later.  Other patches will
convert existing code to use the new macros.

TODO: write more detailed API documentation

Signed-off-by: Eduardo Habkost <address@hidden>
---
 include/qapi/error.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 38f7afba2e..1000853051 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -119,6 +119,9 @@
 
 #define IGNORE_ERRORS (NULL)
 
+#define ERR_IS_SET(e) (!!*(e))
+#define ERR_IS_IGNORED(e) (!(e))
+
 /*
  * Overall category of an error.
  * Based on the qapi type QapiErrorClass, but reproduced here for nicer
-- 
2.11.0.259.g40922b1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]