diff options
author | Peng Wu <alexepico@gmail.com> | 2022-05-27 11:17:32 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2022-05-27 11:17:32 +0800 |
commit | a8def492d1c7c1b4e25f4bd23378c57139829f43 (patch) | |
tree | e0ff179f8a427c38d14b731404c24c03f17a34cb | |
parent | 11a75d2429760bdc291bf82e385110f418b14610 (diff) | |
download | ibus-libpinyin-a8def492d1c7c1b4e25f4bd23378c57139829f43.tar.gz |
Write check_result macro
-rw-r--r-- | src/PYUtil.h | 6 |
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 { |