[CMAKE] Define _DEBUG for better ATL debugging (Retry) (#3519)

CORE-17505
This commit is contained in:
Katayama Hirofumi MZ 2021-03-10 22:59:13 +09:00 committed by GitHub
parent 0a26c7c5d2
commit 98203cea23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View file

@ -4,7 +4,6 @@
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#define _DEBUG
#include <tchar.h>
#include <stdarg.h>

View file

@ -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}>)

View file

@ -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);

View file

@ -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;
}