Skip to content

Commit

Permalink
Windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Apr 27, 2021
1 parent 8627996 commit 993cfb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ChunkInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
#include <iostream>
#include <list>
#include <map>
#include <unistd.h>
#include <utility>

#ifdef _WIN32
#else
#include <unistd.h>
#endif

namespace openPMD
{
ChunkInfo::ChunkInfo( Offset offset_in, Extent extent_in )
Expand Down Expand Up @@ -569,7 +573,10 @@ chunk_assignment::RankMeta byMethodCollective( MPI_Comm comm, Method method )
std::string hostname()
{
char hostname[ MAX_HOSTNAME_LENGTH ];
gethostname( hostname, MAX_HOSTNAME_LENGTH );
if( gethostname( hostname, MAX_HOSTNAME_LENGTH ) )
{
throw std::runtime_error( "[gethostname] Could not inquire hostname." );
}
std::string res( hostname );
return res;
}
Expand Down

0 comments on commit 993cfb6

Please sign in to comment.