mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-14 09:41:33 +05:00
fix for OS Windows
This commit is contained in:
parent
ccce4dbe25
commit
20e2c0f2d7
@ -114,7 +114,8 @@ SET(SMESHimpl_SOURCES
|
||||
|
||||
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} )
|
||||
|
@ -33,7 +33,12 @@
|
||||
|
||||
#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;
|
||||
@ -859,7 +864,17 @@ void MgAdapt::execCmd( const char* cmd, int& err)
|
||||
}
|
||||
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!");
|
||||
@ -1084,7 +1099,11 @@ std::string MgAdapt::getFileName() const
|
||||
|
||||
SMESH_Comment aGenericName( aTmpDir );
|
||||
aGenericName << "MgAdapt_";
|
||||
#ifndef WIN32
|
||||
aGenericName << getpid();
|
||||
#else
|
||||
aGenericName << _getpid();
|
||||
#endif
|
||||
aGenericName << "_";
|
||||
aGenericName << std::abs((int)(long) aGenericName.data());
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#include "SMESH_SMESH.hxx"
|
||||
|
||||
namespace MEDCoupling
|
||||
{
|
||||
class MEDFileMesh;
|
||||
@ -54,7 +56,7 @@ struct MgAdaptHypothesisData
|
||||
};
|
||||
|
||||
|
||||
class MgAdapt
|
||||
class SMESH_EXPORT MgAdapt
|
||||
{
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user