Merge commit '589ec40c7ce71d50ea98f7ff283f58ed5283cb29'

This commit is contained in:
Darth Vader 2023-11-18 01:30:46 +00:00
commit 6ce9ad665a
4 changed files with 25 additions and 4 deletions

View File

@ -6,6 +6,7 @@
# define WINVER 0x0400
# endif
# include <afx.h>
// # define nullptr NULL
# endif
# include <windows.h>
# if defined(PHREEQCI_GUI)
@ -2095,12 +2096,22 @@ char* _string_duplicate(const char* token, const char* szFileName, int nLine);
// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#if (_MSC_VER == 1400) // VS2005
namespace std {
__inline bool isnan(double num) {
return _isnan(num) != 0;
}
}
#endif
#include <stdarg.h>
#define snprintf c99_snprintf
#define vsnprintf c99_vsnprintf
#pragma warning( push )
// warning C4793: 'vararg' : causes native code generation
#pragma warning( disable : 4793 )
__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
{
int count = -1;
@ -2124,6 +2135,7 @@ __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
return count;
}
#pragma warning( pop )
#endif // defined(_MSC_VER) && (_MSC_VER < 1900)
#endif //_INC_MISSING_SNPRINTF_H

View File

@ -12,6 +12,10 @@
#include "float.h"
#include <cmath>
#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005
# define nullptr NULL
#endif
#if defined(PHREEQCI_GUI)
#ifdef _DEBUG
#define new DEBUG_NEW

View File

@ -6,9 +6,14 @@
* #define DEFINITIONS
* ---------------------------------------------------------------------- */
#if !defined(NAN)
#define NAN nan("1")
# if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005
# include <limits>
# define NAN std::numeric_limits<double>::signaling_NaN()
# else
# define NAN nan("1")
# endif
#endif
#define MISSING -9999.999
#define MISSING -9999.999
#include "NA.h" /* NA = not available */
#define F_C_MOL 96493.5 /* C/mol or joule/volt-eq */

View File

@ -1074,7 +1074,7 @@ calc_psi_avg(cxxSurfaceCharge *charge_ptr, LDBLE surf_chrg_eq, LDBLE nDbl, std::
cgc[10] = { 0.36, 0.1721, 0.798, 0.287, 0.1457, 1.2, 0.285, 0.372 };
if (!surf_p->Donnan_factors.empty())
std::copy(std::begin(surf_p->Donnan_factors), std::end(surf_p->Donnan_factors), cgc);
std::copy(surf_p->Donnan_factors.begin(), surf_p->Donnan_factors.end(), cgc);
cgc[1] *= pow(nDbl, cgc[2]) * pow(Gamma, cgc[3]) * pow(mu_x, cgc[4]);