Julius Pfrommer 9 anni fa
parent
commit
573b378b40

+ 4 - 0
src/server/ua_services_attribute.c

@@ -15,7 +15,11 @@ static
 UA_StatusCode parse_numericrange(const UA_String str, UA_NumericRange *range) {
     if(str.length < 0 || str.length >= 1023)
         return UA_STATUSCODE_BADINTERNALERROR;
+#ifdef _MSVC_VER
+    char *cstring = UA_alloca(str.length+1);
+#else
     char cstring[str.length+1];
+#endif
     UA_memcpy(cstring, str.data, str.length);
     cstring[str.length] = 0;
     UA_Int32 index = 0;

+ 5 - 0
src/server/ua_services_nodemanagement.c

@@ -276,8 +276,13 @@ void Service_AddNodes(UA_Server *server, UA_Session *session, const UA_AddNodesR
     }
     
 #ifdef UA_EXTERNAL_NAMESPACES
+#ifdef _MSVC_VER
+    UA_Boolean *isExternal = UA_alloca(size);
+    UA_UInt32 *indices = UA_alloca(sizeof(UA_UInt32)*size);
+#else
     UA_Boolean isExternal[size];
     UA_UInt32 indices[size];
+#endif
     UA_memset(isExternal, UA_FALSE, sizeof(UA_Boolean) * size);
     for(size_t j = 0; j <server->externalNamespacesSize; j++) {
         size_t indexSize = 0;