changes for Windows

This commit is contained in:
Dave Goodwin 2007-02-17 11:35:53 +00:00
parent 616eaba372
commit 1084b43e24
3 changed files with 13 additions and 8 deletions

View file

@ -9,9 +9,10 @@
#pragma warning(disable:4786)
#endif
using namespace std;
#include "SpeciesThermoFactory.h"
using namespace std;
#include "SpeciesThermo.h"
#include "NasaThermo.h"
@ -28,6 +29,7 @@ using namespace std;
using namespace ctml;
namespace Cantera {
SpeciesThermoFactory* SpeciesThermoFactory::s_factory = 0;

View file

@ -51,7 +51,7 @@ public:
//! string name
std::vector<std::string> eqn;
//! string vector of ints
std::vector<int> dup,;
std::vector<int> dup;
//! string vector of ints
std::vector<int> nr;
//! string vector of ints

View file

@ -9,6 +9,9 @@
#ifdef WIN32
#pragma warning(disable:4786)
#pragma warning(disable:4503)
#define SNPRINTF _snprintf
#else
#define SNPRINTF snprintf
#endif
#include "ct_defs.h"
@ -24,8 +27,8 @@ namespace Cantera {
* Convert a floating point number to a std::string using sprintf.
*/
std::string fp2str(double x, std::string fmt) {
char buf[30];
int n = snprintf(buf, 30, fmt.c_str(), x);
char buf[30];
int n = SNPRINTF(buf, 30, fmt.c_str(), x);
if (n > 0) {
buf[29] = '\0';
return std::string(buf);
@ -34,7 +37,7 @@ namespace Cantera {
}
std::string fp2str(double x) {
char buf[30];
int n = snprintf(buf, 30, "%g" , x);
int n = SNPRINTF(buf, 30, "%g" , x);
if (n > 0) {
buf[29] = '\0';
return std::string(buf);
@ -47,8 +50,8 @@ namespace Cantera {
*/
std::string int2str(int n, std::string fmt) {
char buf[30];
int m = snprintf(buf, 30, fmt.c_str(), n);
sprintf(buf, fmt.c_str(), n);
int m = SNPRINTF(buf, 30, fmt.c_str(), n);
//sprintf(buf, fmt.c_str(), n);
if (m > 0) {
buf[29] = '\0';
return std::string(buf);
@ -59,7 +62,7 @@ namespace Cantera {
std::string int2str(int n) {
char buf[30];
int m = snprintf(buf, 30, "%d", n);
int m = SNPRINTF(buf, 30, "%d", n);
if (m > 0) {
buf[29] = '\0';
return std::string(buf);