From f09b14a2cbcb189af2e95891b10077b9d7639bec Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Thu, 29 Aug 2024 21:08:26 +0000 Subject: [PATCH] Squashed 'src/' changes from c477ba11..fdc0bb51 fdc0bb51 fixed nullptr for pre-c++11 git-subtree-dir: src git-subtree-split: fdc0bb51869877771df528f727fe577f58877c7d --- PBasic.cpp | 10 ++++++++++ basicsubs.cpp | 10 ++++++++++ print.cpp | 10 ++++++++++ transport.cpp | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/PBasic.cpp b/PBasic.cpp index 53dda855b..0b7b68dc3 100644 --- a/PBasic.cpp +++ b/PBasic.cpp @@ -24,6 +24,16 @@ #define toklength 20 typedef long chset[9]; +#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005 +# define nullptr NULL +#endif + +#if __cplusplus < 201103L // Check if C++ standard is pre-C++11 +# ifndef nullptr +# define nullptr NULL +# endif +#endif + #if defined(PHREEQCI_GUI) #ifdef _DEBUG #define new DEBUG_NEW diff --git a/basicsubs.cpp b/basicsubs.cpp index 7724d0621..917353dac 100644 --- a/basicsubs.cpp +++ b/basicsubs.cpp @@ -12,6 +12,16 @@ #include "Solution.h" #include "Parser.h" +#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005 +# define nullptr NULL +#endif + +#if __cplusplus < 201103L // Check if C++ standard is pre-C++11 +# ifndef nullptr +# define nullptr NULL +# endif +#endif + #if defined(PHREEQCI_GUI) #ifdef _DEBUG #define new DEBUG_NEW diff --git a/print.cpp b/print.cpp index 033d48993..4aa70fb6a 100644 --- a/print.cpp +++ b/print.cpp @@ -15,6 +15,16 @@ #include "Solution.h" #include "Surface.h" +#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005 +# define nullptr NULL +#endif + +#if __cplusplus < 201103L // Check if C++ standard is pre-C++11 +# ifndef nullptr +# define nullptr NULL +# endif +#endif + #if defined(PHREEQCI_GUI) #ifdef _DEBUG #define new DEBUG_NEW diff --git a/transport.cpp b/transport.cpp index c49ee26b3..6e69e8df7 100644 --- a/transport.cpp +++ b/transport.cpp @@ -52,6 +52,16 @@ struct MOLES_ADDED /* total moles added to balance negative conc's */ } *moles_added; int count_moles_added; +#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005 +# define nullptr NULL +#endif + +#if __cplusplus < 201103L // Check if C++ standard is pre-C++11 +# ifndef nullptr +# define nullptr NULL +# endif +#endif + #if defined(PHREEQCI_GUI) #ifdef _DEBUG #define new DEBUG_NEW