ADD_LIBRARY(SMESHimpl ${SMESHimpl_SOURCES})
IF(WIN32)
- TARGET_COMPILE_OPTIONS(SMESHimpl PRIVATE /bigobj)
+ TARGET_COMPILE_OPTIONS(SMESHimpl PRIVATE /bigobj)
+ ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(WIN32)
TARGET_LINK_LIBRARIES(SMESHimpl ${_link_LIBRARIES} )
#include <Utils_SALOME_Exception.hxx>
+#ifndef WIN32
#include <unistd.h> // getpid()
+#else
+#include <process.h>
+#endif
+#include <array>
#include <memory> // unique_ptr
typedef SMESH_Comment ToComment;
}
std::ostream logStream(buf);
+
+#if defined(WIN32)
+#if defined(INICODE)
+ std::unique_ptr <FILE, decltype(&_pclose)> pipe(_wopen(cmd, "r"), _pclose );
+#else
+ std::unique_ptr <FILE, decltype(&_pclose)> pipe(_popen(cmd, "r"), _pclose );
+#endif
+#else
std::unique_ptr <FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose );
+#endif
+
if(!pipe)
{
throw std::runtime_error("popen() failed!");
SMESH_Comment aGenericName( aTmpDir );
aGenericName << "MgAdapt_";
+#ifndef WIN32
aGenericName << getpid();
+#else
+aGenericName << _getpid();
+#endif
aGenericName << "_";
aGenericName << std::abs((int)(long) aGenericName.data());