https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a65014e3a0cc73ba1dbb6…
commit a65014e3a0cc73ba1dbb6a39fdd614c4d3f06f07
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Oct 23 12:49:37 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sun Oct 23 12:49:37 2022 +0900
[IMM32] Add UNEXPECTED() macro for detailed debugging
CORE-11700
---
dll/win32/imm32/precomp.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h
index 629eaba4e4b..6db1f8d6e4d 100644
--- a/dll/win32/imm32/precomp.h
+++ b/dll/win32/imm32/precomp.h
@@ -100,6 +100,12 @@ BOOL APIENTRY Imm32IsCrossThreadAccess(HIMC hIMC);
BOOL APIENTRY Imm32IsCrossProcessAccess(HWND hWnd);
BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC);
+#if 0
+ #define UNEXPECTED() ASSERT(FALSE)
+#else
+ #define UNEXPECTED() 0
+#endif
+
/*
* Unexpected Condition Checkers
* --- Examine the condition, and then generate trace log if necessary.
@@ -113,19 +119,19 @@ BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC);
#else /* on Debug */
#define IS_NULL_UNEXPECTEDLY(p) \
(!(p) ? (ros_dbg_log(__WINE_DBCL_ERR, __wine_dbch___default, \
- __FILE__, __FUNCTION__, __LINE__, "%s was NULL\n",
#p), TRUE) \
+ __FILE__, __FUNCTION__, __LINE__, "%s was NULL\n",
#p), UNEXPECTED(), TRUE) \
: FALSE)
#define IS_ZERO_UNEXPECTEDLY(p) \
(!(p) ? (ros_dbg_log(__WINE_DBCL_ERR, __wine_dbch___default, \
- __FILE__, __FUNCTION__, __LINE__, "%s was zero\n",
#p), TRUE) \
+ __FILE__, __FUNCTION__, __LINE__, "%s was zero\n",
#p), UNEXPECTED(), TRUE) \
: FALSE)
#define IS_TRUE_UNEXPECTEDLY(x) \
((x) ? (ros_dbg_log(__WINE_DBCL_ERR, __wine_dbch___default, \
- __FILE__, __FUNCTION__, __LINE__, "%s was non-zero\n",
#x), TRUE) \
+ __FILE__, __FUNCTION__, __LINE__, "%s was non-zero\n",
#x), UNEXPECTED(), TRUE) \
: FALSE)
#define IS_FALSE_UNEXPECTEDLY(x) \
((!(x)) ? (ros_dbg_log(__WINE_DBCL_ERR, __wine_dbch___default, \
- __FILE__, __FUNCTION__, __LINE__, "%s was FALSE\n",
#x), TRUE) \
+ __FILE__, __FUNCTION__, __LINE__, "%s was FALSE\n",
#x), UNEXPECTED(), TRUE) \
: FALSE)
#define IS_ERROR_UNEXPECTEDLY(x) \
((x) != ERROR_SUCCESS ? (ros_dbg_log(__WINE_DBCL_ERR, __wine_dbch___default, \