Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review/cpp17 #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ option(CRASHRPT_BUILD_SHARED_LIBS "If set (default), CrashRpt modules are built
option(CRASHRPT_LINK_CRT_AS_DLL "If set (default), CrashRpt modules link C run-time (CRT) as multi-threaded dynamic libraries, otherwise as multi-threaded static libs." ON)
option(CRASHRPT_BUILD_DEMOS "If set (default), CrashRpt builds the demo projects." ON)
option(CRASHRPT_BUILD_TESTS "If set (default), CrashRpt builds the test projects." ON)
IF(MSVC AND ${MSVC_VERSION} GREATER 1910)
option(CRASHRPT_BUILD_CPP17 "If set (default), CrashRpt builds using /std:c++17 mode." ON)
ENDIF()

ADD_DEFINITIONS("/W4 /wd4456 /wd4458 /MP /Oy- /EHsc")
IF(MSVC AND ${MSVC_VERSION} GREATER 1910 AND CRASHRPT_BUILD_CPP17)
MESSAGE("Using /std:c++17 mode and /permissive-")
ADD_DEFINITIONS("/std:c++17 /permissive- /Zc:strictStrings-")
ENDIF()

if(MSVC_VERSION LESS 1910 )
set( DBGHELP_USE_INSTALLED_SDK True )
Expand Down
6 changes: 3 additions & 3 deletions demos/WTLDemo/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ be found in the Authors.txt file in the root of the source tree.
#pragma once

// Change these values to use different versions
#define WINVER 0x0500
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#define _WIN32_IE 0x0501
#define _RICHEDIT_VER 0x0200
#define _WIN32_IE 0x0600
#define _RICHEDIT_VER 0x0300

#include <atldef.h>
#if ( _ATL_VER < 0x0800 )
Expand Down
10 changes: 5 additions & 5 deletions processing/crashrptprobe/CrashRptProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ CComAutoCriticalSection g_crp_cs; // Critical section for thread-safe accessing
std::map<DWORD, CString> g_crp_sErrorMsg; // Last error messages for each calling thread.

// Funtion prototype
int crpSetErrorMsg(PTSTR pszErrorMsg);
int crpSetErrorMsg(LPCTSTR pszErrorMsg);

TCHAR* exctypes[13] =
const TCHAR* exctypes[13] =
{
_T("SEH exception"),
_T("terminate call"),
Expand Down Expand Up @@ -880,7 +880,7 @@ crpGetPropertyW(
_ULTOT_S(pDmpReader->m_DumpData.m_uProcessorArchitecture, szBuff, BUFF_SIZE, 10);
_TCSCAT_S(szBuff, BUFF_SIZE, _T(" "));

TCHAR* szDescription = _T("unknown processor type");
const TCHAR* szDescription = _T("unknown processor type");
if(pDmpReader->m_DumpData.m_uProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
szDescription = _T("x64 (AMD or Intel)");
if(pDmpReader->m_DumpData.m_uProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA32_ON_WIN64)
Expand All @@ -904,7 +904,7 @@ crpGetPropertyW(
_ULTOT_S(pDmpReader->m_DumpData.m_uchProductType, szBuff, BUFF_SIZE, 10);
_TCSCAT_S(szBuff, BUFF_SIZE, _T(" "));

TCHAR* szDescription = _T("unknown product type");
const TCHAR* szDescription = _T("unknown product type");
if(pDmpReader->m_DumpData.m_uchProductType==VER_NT_DOMAIN_CONTROLLER)
szDescription = _T("domain controller");
if(pDmpReader->m_DumpData.m_uchProductType==VER_NT_SERVER)
Expand Down Expand Up @@ -1374,7 +1374,7 @@ crpGetLastErrorMsgA(
return res;
}

int crpSetErrorMsg(PTSTR pszErrorMsg)
int crpSetErrorMsg(LPCTSTR pszErrorMsg)
{
g_crp_cs.Lock();
DWORD dwThreadId = GetCurrentThreadId();
Expand Down
Loading