https://git.reactos.org/?p=reactos.git;a=commitdiff;h=98203cea23af32415dea9…
commit 98203cea23af32415dea91a280c47afcf4c388d4
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Mar 10 22:59:13 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Mar 10 22:59:13 2021 +0900
[CMAKE] Define _DEBUG for better ATL debugging (Retry) (#3519)
CORE-17505
---
base/applications/rapps/include/defines.h | 1 -
sdk/lib/atl/CMakeLists.txt | 3 +++
sdk/lib/atl/atlcom.h | 2 +-
sdk/lib/atl/statreg.h | 6 +++---
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/base/applications/rapps/include/defines.h
b/base/applications/rapps/include/defines.h
index d5247963725..a8177811a1d 100644
--- a/base/applications/rapps/include/defines.h
+++ b/base/applications/rapps/include/defines.h
@@ -4,7 +4,6 @@
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
-#define _DEBUG
#include <tchar.h>
#include <stdarg.h>
diff --git a/sdk/lib/atl/CMakeLists.txt b/sdk/lib/atl/CMakeLists.txt
index 6923a49bb8f..d8d4c149ffb 100644
--- a/sdk/lib/atl/CMakeLists.txt
+++ b/sdk/lib/atl/CMakeLists.txt
@@ -1,5 +1,8 @@
add_library(atl_classes INTERFACE)
+if(DBG)
+ target_compile_definitions(atl_classes INTERFACE _DEBUG)
+endif(DBG)
target_include_directories(atl_classes INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}>)
diff --git a/sdk/lib/atl/atlcom.h b/sdk/lib/atl/atlcom.h
index 9c45c2eab2a..544de73244c 100644
--- a/sdk/lib/atl/atlcom.h
+++ b/sdk/lib/atl/atlcom.h
@@ -456,7 +456,7 @@ class CComCreator2
public:
static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv)
{
- ATLASSERT(ppv != NULL && &riid != NULL);
+ ATLASSERT(ppv != NULL);
if (pv == NULL)
return T1::CreateInstance(NULL, riid, ppv);
diff --git a/sdk/lib/atl/statreg.h b/sdk/lib/atl/statreg.h
index daf8312b7a3..b027d31c154 100644
--- a/sdk/lib/atl/statreg.h
+++ b/sdk/lib/atl/statreg.h
@@ -68,19 +68,19 @@ public:
HRESULT STDMETHODCALLTYPE QueryInterface(const IID & /* riid */, void ** /*
ppvObject */ )
{
- ATLASSERT(_T("statically linked in CRegObject is not a com object. Do not
callthis function"));
+ ATLASSERT(FALSE && TEXT("statically linked in CRegObject is not a
com object. Do not call this function"));
return E_NOTIMPL;
}
ULONG STDMETHODCALLTYPE AddRef()
{
- ATLASSERT(_T("statically linked in CRegObject is not a com object. Do not
callthis function"));
+ ATLASSERT(FALSE && TEXT("statically linked in CRegObject is not a
com object. Do not call this function"));
return 1;
}
ULONG STDMETHODCALLTYPE Release()
{
- ATLASSERT(_T("statically linked in CRegObject is not a com object. Do not
callthis function"));
+ ATLASSERT(FALSE && TEXT("statically linked in CRegObject is not a
com object. Do not call this function"));
return 0;
}