summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2022-05-27 11:17:32 +0800
committerPeng Wu <alexepico@gmail.com>2022-05-27 11:17:32 +0800
commita8def492d1c7c1b4e25f4bd23378c57139829f43 (patch)
treee0ff179f8a427c38d14b731404c24c03f17a34cb
parent11a75d2429760bdc291bf82e385110f418b14610 (diff)
downloadibus-libpinyin-a8def492d1c7c1b4e25f4bd23378c57139829f43.tar.gz
Write check_result macro
-rw-r--r--src/PYUtil.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PYUtil.h b/src/PYUtil.h
index c5f7db2..d5cc497 100644
--- a/src/PYUtil.h
+++ b/src/PYUtil.h
@@ -45,6 +45,12 @@ namespace std {
#endif
+#if defined(NDEBUG) || defined(G_DISABLE_ASSERT)
+#define check_result(expr) expr
+#else
+#define check_result(expr) assert(expr)
+#endif
+
#include <ibus.h>
namespace PY {