From 233f03ea8ecbb54db17d872e81b6064fa3d60fb6 Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 11 May 2018 18:03:49 -0400
Subject: [PATCH] windows portability bugfix

---
 lib/atc/Function.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/atc/Function.cpp b/lib/atc/Function.cpp
index fb615e7bef..6004937a01 100644
--- a/lib/atc/Function.cpp
+++ b/lib/atc/Function.cpp
@@ -1,4 +1,6 @@
+#ifndef _WIN32
 #include <alloca.h>
+#endif
 #include "Function.h"
 #include "ATC_Error.h"
 #include "LammpsInterface.h"
@@ -59,7 +61,11 @@ namespace ATC {
   {
     string type = args[0];
     int narg = nargs -1;
+#ifdef _WIN32
+    double *dargs = (double *) _alloca(sizeof(double) * narg);
+#endif
     double *dargs = (double *) alloca(sizeof(double) * narg);
+#endif
     for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
   
     return function(type, narg, dargs);
@@ -193,7 +199,11 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL;
   {
     string type = args[0];
     int narg = nargs -1;
+#ifdef _WIN32
+    double *dargs = (double *) _alloca(sizeof(double) * narg);
+#else
     double *dargs = (double *) alloca(sizeof(double) * narg);
+#endif
     for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
   
     return function(type, narg, dargs);
-- 
GitLab