diff --git a/CMakeLists.txt b/CMakeLists.txt index 2728e702..db306038 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) project(calculator) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) add_subdirectory(src) diff --git a/src/CalcManager/CEngine/calc.cpp b/src/CalcManager/CEngine/calc.cpp index 92a551e2..74456c4f 100644 --- a/src/CalcManager/CEngine/calc.cpp +++ b/src/CalcManager/CEngine/calc.cpp @@ -8,9 +8,11 @@ #endif #include "Header Files/CalcEngine.h" - #include "CalculatorResource.h" +#include +#include + using namespace std; using namespace CalcEngine; @@ -24,8 +26,8 @@ static constexpr int32_t DEFAULT_RADIX = 10; static constexpr wchar_t DEFAULT_DEC_SEPARATOR = L'.'; static constexpr wchar_t DEFAULT_GRP_SEPARATOR = L','; -static constexpr wstring_view DEFAULT_GRP_STR = L"3;0"; -static constexpr wstring_view DEFAULT_NUMBER_STR = L"0"; +static const wstring_view DEFAULT_GRP_STR = L"3;0"; +static const wstring_view DEFAULT_NUMBER_STR = L"0"; // Read strings for keys, errors, trig types, etc. // These will be copied from the resources to local memory. diff --git a/src/CalcManager/CEngine/scidisp.cpp b/src/CalcManager/CEngine/scidisp.cpp index de4fd715..a8c9b3ef 100644 --- a/src/CalcManager/CEngine/scidisp.cpp +++ b/src/CalcManager/CEngine/scidisp.cpp @@ -26,8 +26,8 @@ using namespace CalcEngine; constexpr int MAX_EXPONENT = 4; constexpr uint32_t MAX_GROUPING_SIZE = 16; -constexpr wstring_view c_decPreSepStr = L"[+-]?(\\d*)["; -constexpr wstring_view c_decPostSepStr = L"]?(\\d*)(?:e[+-]?(\\d*))?$"; +const wstring_view c_decPreSepStr = L"[+-]?(\\d*)["; +const wstring_view c_decPostSepStr = L"]?(\\d*)(?:e[+-]?(\\d*))?$"; /****************************************************************************\ diff --git a/src/CalcManager/Header Files/CalcEngine.h b/src/CalcManager/Header Files/CalcEngine.h index 48597f1c..d44a1b8c 100644 --- a/src/CalcManager/Header Files/CalcEngine.h +++ b/src/CalcManager/Header Files/CalcEngine.h @@ -32,6 +32,8 @@ #include "Rational.h" #include "RationalMath.h" +#include + // The following are NOT real exports of CalcEngine, but for forward declarations // The real exports follows later diff --git a/src/CalcManager/Header Files/EngineStrings.h b/src/CalcManager/Header Files/EngineStrings.h index 2ada6bba..2e58c283 100644 --- a/src/CalcManager/Header Files/EngineStrings.h +++ b/src/CalcManager/Header Files/EngineStrings.h @@ -13,6 +13,11 @@ * Created: 13-Feb-2008 * \****************************************************************************/ + +#pragma once + +#include + #define IDS_FIRSTENGSTR IDS_ENGINESTR_FIRST #define IDS_DECIMAL 4 diff --git a/src/CalcManager/win_data_types_cross_platform.h b/src/CalcManager/win_data_types_cross_platform.h index daa99bd6..b4178a83 100644 --- a/src/CalcManager/win_data_types_cross_platform.h +++ b/src/CalcManager/win_data_types_cross_platform.h @@ -6,6 +6,7 @@ typedef uint64_t ULONGLONG; typedef int INT; typedef char CHAR; typedef long LONG; +typedef unsigned char BYTE; typedef unsigned int UINT_PTR; typedef unsigned long ULONG_PTR; typedef unsigned int ULONG32; @@ -21,3 +22,5 @@ typedef ULONG_PTR DWORD_PTR; #define HIWORD(dw) ((WORD)((((DWORD_PTR)(dw)) >> 16) & 0xffff)) #define LODWORD(qw) ((DWORD)(qw)) #define HIDWORD(qw) ((DWORD)(((qw) >> 32) & 0xffffffff)) + +#define ARRAYSIZE(a) (sizeof(a) / sizeof(*a)) diff --git a/src/CalcManager/winerror_cross_platform.h b/src/CalcManager/winerror_cross_platform.h index 6961e77f..4c6730c0 100644 --- a/src/CalcManager/winerror_cross_platform.h +++ b/src/CalcManager/winerror_cross_platform.h @@ -16,3 +16,4 @@ typedef int32_t HRESULT; #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) #define FAILED(hr) (((HRESULT)(hr)) < 0) +#define SCODE_CODE(sc) ((sc) & 0xFFFF)