Skip to content

Commit

Permalink
Refs #8570. Fix the Windows building problem.
Browse files Browse the repository at this point in the history
Apparently Windows compiler doesn't like allocating dynamic size
arrays on the stack.
  • Loading branch information
arturbekasov committed Jan 29, 2014
1 parent 4341f27 commit fb61f03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Code/Mantid/Framework/Nexus/inc/MantidNexus/NexusFileIO.h
Expand Up @@ -9,6 +9,8 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/local_time_adjustor.hpp>
#include <boost/date_time/c_local_time_adjustor.hpp>
#include <boost/scoped_array.hpp>

#include <limits.h>
#include <nexus/NeXusFile.hpp>

Expand Down Expand Up @@ -391,7 +393,8 @@ namespace Mantid
dims[1] = static_cast<int>(maxSize);

// Create data array
Type data[rowCount * maxSize];
boost::scoped_array<Type> data(new Type[rowCount * maxSize]);

for ( size_t i = 0; i < rowCount; ++i )
{
auto values = column->template cell< std::vector<Type> >(i);
Expand All @@ -405,7 +408,7 @@ namespace Mantid
}

// Write data
NXwritedata(columnName.c_str(), nexusType, 2, dims, reinterpret_cast<void*>(&data), false);
NXwritedata(columnName.c_str(), nexusType, 2, dims, reinterpret_cast<void*>(data.get()), false);

std::string units = "Not known";
std::string interpret_as = "A vector of " + typeName;
Expand Down

0 comments on commit fb61f03

Please sign in to comment.