Skip to content
Snippets Groups Projects
Commit 233f03ea authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

windows portability bugfix

parent 075598b4
No related branches found
No related tags found
No related merge requests found
#ifndef _WIN32
#include <alloca.h> #include <alloca.h>
#endif
#include "Function.h" #include "Function.h"
#include "ATC_Error.h" #include "ATC_Error.h"
#include "LammpsInterface.h" #include "LammpsInterface.h"
...@@ -59,7 +61,11 @@ namespace ATC { ...@@ -59,7 +61,11 @@ namespace ATC {
{ {
string type = args[0]; string type = args[0];
int narg = nargs -1; int narg = nargs -1;
#ifdef _WIN32
double *dargs = (double *) _alloca(sizeof(double) * narg);
#endif
double *dargs = (double *) alloca(sizeof(double) * narg); double *dargs = (double *) alloca(sizeof(double) * narg);
#endif
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]); for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
return function(type, narg, dargs); return function(type, narg, dargs);
...@@ -193,7 +199,11 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; ...@@ -193,7 +199,11 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL;
{ {
string type = args[0]; string type = args[0];
int narg = nargs -1; int narg = nargs -1;
#ifdef _WIN32
double *dargs = (double *) _alloca(sizeof(double) * narg);
#else
double *dargs = (double *) alloca(sizeof(double) * narg); double *dargs = (double *) alloca(sizeof(double) * narg);
#endif
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]); for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
return function(type, narg, dargs); return function(type, narg, dargs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment