mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Squashed 'phreeqcpp/' changes from 3e6c2e9..ff1cc7a
ff1cc7a [phreeqci] Updated to compile on vs2005 git-subtree-dir: phreeqcpp git-subtree-split: ff1cc7aa82e0ec1145f593a84025ff174af18463
This commit is contained in:
parent
deb497735e
commit
589ec40c7c
14
Phreeqc.h
14
Phreeqc.h
@ -6,6 +6,7 @@
|
|||||||
# define WINVER 0x0400
|
# define WINVER 0x0400
|
||||||
# endif
|
# endif
|
||||||
# include <afx.h>
|
# include <afx.h>
|
||||||
|
// # define nullptr NULL
|
||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# if defined(PHREEQCI_GUI)
|
# 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
|
// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
#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>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define snprintf c99_snprintf
|
#define snprintf c99_snprintf
|
||||||
#define vsnprintf c99_vsnprintf
|
#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)
|
__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
int count = -1;
|
int count = -1;
|
||||||
@ -2124,6 +2135,7 @@ __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
#pragma warning( pop )
|
||||||
#endif // defined(_MSC_VER) && (_MSC_VER < 1900)
|
#endif // defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||||
|
|
||||||
#endif //_INC_MISSING_SNPRINTF_H
|
#endif //_INC_MISSING_SNPRINTF_H
|
||||||
|
|||||||
@ -12,6 +12,10 @@
|
|||||||
#include "float.h"
|
#include "float.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005
|
||||||
|
# define nullptr NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PHREEQCI_GUI)
|
#if defined(PHREEQCI_GUI)
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
|
|||||||
@ -6,9 +6,14 @@
|
|||||||
* #define DEFINITIONS
|
* #define DEFINITIONS
|
||||||
* ---------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------- */
|
||||||
#if !defined(NAN)
|
#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
|
#endif
|
||||||
#define MISSING -9999.999
|
#define MISSING -9999.999
|
||||||
#include "NA.h" /* NA = not available */
|
#include "NA.h" /* NA = not available */
|
||||||
|
|
||||||
#define F_C_MOL 96493.5 /* C/mol or joule/volt-eq */
|
#define F_C_MOL 96493.5 /* C/mol or joule/volt-eq */
|
||||||
|
|||||||
@ -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 };
|
cgc[10] = { 0.36, 0.1721, 0.798, 0.287, 0.1457, 1.2, 0.285, 0.372 };
|
||||||
|
|
||||||
if (!surf_p->Donnan_factors.empty())
|
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]);
|
cgc[1] *= pow(nDbl, cgc[2]) * pow(Gamma, cgc[3]) * pow(mu_x, cgc[4]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user