From: abd Date: Fri, 3 Oct 2008 09:37:12 +0000 (+0000) Subject: Win32 Porting. X-Git-Tag: RELIQUAT_4x_25102008~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=53e7815e0acb43cc2a1faa4dd3e48c2bf30e5fb7;p=modules%2Fkernel.git Win32 Porting. Correction of Export/Import defines for Win32 platform. Using WIN32 standard define instead WNT define of OpenCascade library. Using Basics instead Utils library. Removed "using namespace std" from header files. --- diff --git a/src/Launcher/BatchTest.cxx b/src/Launcher/BatchTest.cxx index bb44166f4..c51301490 100644 --- a/src/Launcher/BatchTest.cxx +++ b/src/Launcher/BatchTest.cxx @@ -1,5 +1,15 @@ #include "BatchTest.hxx" +#include "Batch_Date.hxx" +#include "MpiImpl.hxx" +#include "utilities.h" + +#include +#include +#include +#ifdef WIN32 +# include +#endif BatchTest::BatchTest(const Engines::MachineParameters& batch_descr) { _batch_descr = batch_descr; @@ -17,7 +27,7 @@ BatchTest::BatchTest(const Engines::MachineParameters& batch_descr) } i++ ; } - + // Creating test temporary file _test_filename = "/tmp/"; _test_filename += _date + "_test_cluster_file_"; @@ -66,11 +76,11 @@ BatchTest::test() << "--- Application : " << result_appli << std::endl ); - if (result_connection == "OK" and - result_filecopy == "OK" and - result_getresult == "OK" and - result_jobsubmit_simple == "OK" and - result_jobsubmit_mpi == "OK" and + if (result_connection == "OK" && + result_filecopy == "OK" && + result_getresult == "OK" && + result_jobsubmit_simple == "OK" && + result_jobsubmit_mpi == "OK" && result_appli == "OK") rtn = true; @@ -99,7 +109,7 @@ BatchTest::test_connection() result += "username is empty !"; return result; } - if( protocol != "rsh" and protocol != "ssh") + if( protocol != "rsh" && protocol != "ssh") { result += "protocol unknown ! (" + protocol + ")"; return result; @@ -341,7 +351,11 @@ BatchTest::test_jobsubmit_simple() if(status == 153 || status == 256*153 ) stop = true; +#ifdef WIN32 + Sleep(1); +#else sleep(1); +#endif } // Build command for getting results @@ -446,7 +460,12 @@ BatchTest::test_jobsubmit_mpi() << "echo HELLO MPI\n"; file_script.flush(); file_script.close(); - chmod(_test_file_script.c_str(), 0x1ED); +#ifdef WIN32 + _chmod +#else + chmod +#endif + (_test_file_script.c_str(), 0x1ED); std::string _test_file_mpi = _test_filename + "_mpi"; std::ofstream file_mpi; @@ -529,7 +548,11 @@ BatchTest::test_jobsubmit_mpi() if(status == 153 || status == 256*153 ) stop = true; +#ifdef WIN32 + Sleep(1); +#else sleep(1); +#endif } // Build command for getting results @@ -569,7 +592,7 @@ BatchTest::test_jobsubmit_mpi() return result; } result = "OK"; - return result; + return result; } std::string diff --git a/src/Launcher/BatchTest.hxx b/src/Launcher/BatchTest.hxx index 600b71bee..da32b1db3 100644 --- a/src/Launcher/BatchTest.hxx +++ b/src/Launcher/BatchTest.hxx @@ -21,18 +21,14 @@ #ifndef __BatchTest_HXX__ #define __BatchTest_HXX__ -#include -#include -#include +#include "SALOME_Launcher_defs.hxx" #include -#include "utilities.h" #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) -#include "Batch_Date.hxx" -#include "MpiImpl.hxx" +#include -class BatchTest +class SALOMELAUNCHER_EXPORT BatchTest { public: BatchTest(const Engines::MachineParameters& batch_descr); diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 9f9f3904d..589ec566f 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -17,10 +17,14 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + +#include "Launcher.hxx" + #include "Batch_Date.hxx" #include "Batch_FactBatchManager_eLSF.hxx" #include "Batch_FactBatchManager_ePBS.hxx" -#include "Launcher.hxx" +#include "Batch_BatchManager_eClient.hxx" + #include #include #include @@ -156,7 +160,7 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute , istringstream iss(jid.getReference()); iss >> jobId; - _jobmap[ pair(clustername,jobId) ] = job; + _jobmap[ pair(clustername,jobId) ] = job; } catch(const Batch::EmulationException &ex){ throw LauncherException(ex.msg.c_str()); @@ -320,6 +324,7 @@ Batch::BatchManager_eClient *Launcher_cpp::FactoryBatchManager( const ParserReso string Launcher_cpp::buildSalomeCouplingScript(const string fileToExecute, const string dirForTmpFiles, const ParserResourcesType& params) { +#ifndef WIN32 //TODO: need for porting on Windows int idx = dirForTmpFiles.find("Batch/"); std::string filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length()); @@ -429,6 +434,9 @@ string Launcher_cpp::buildSalomeCouplingScript(const string fileToExecute, const delete mpiImpl; return TmpFileName; +#else + return ""; +#endif } @@ -548,7 +556,7 @@ bool Launcher_cpp::check(const batchParams& batch_params) rtn = false; } std::string end_mem_value = mem_value.substr(mem_value.length()-2); - if (end_mem_value != "gb" and end_mem_value != "mb") { + if (end_mem_value != "gb" && end_mem_value != "mb") { mem_info = "Error on definition, type is bad ! " + mem_value; rtn = false; } diff --git a/src/Launcher/Launcher.hxx b/src/Launcher/Launcher.hxx index 84dd59dd5..fdf3eba54 100644 --- a/src/Launcher/Launcher.hxx +++ b/src/Launcher/Launcher.hxx @@ -20,10 +20,28 @@ #ifndef __LAUNCHER_HXX__ #define __LAUNCHER_HXX__ -#include "Batch_BatchManager_eClient.hxx" +#ifdef WIN32 +# ifdef LAUNCHER_EXPORTS +# define LAUNCHER_EXPORT __declspec(dllexport) +# else +# define LAUNCHER_EXPORT __declspec(dllimport) +# endif +#else +# define LAUNCHER_EXPORT +#endif + +#include #include "ResourcesManager.hxx" #include +#include + +class MpiImpl; + +namespace Batch{ + class BatchManager_eClient; + class Job; +} struct batchParams{ std::string batch_directory; @@ -32,7 +50,7 @@ struct batchParams{ unsigned long nb_proc; }; -class LauncherException +class LAUNCHER_EXPORT LauncherException { public: const std::string msg; @@ -40,7 +58,7 @@ public: LauncherException(const std::string m) : msg(m) {} }; -class Launcher_cpp +class LAUNCHER_EXPORT Launcher_cpp { public: @@ -61,7 +79,7 @@ public: protected: - std::string buildSalomeCouplingScript(const string fileToExecute, const string dirForTmpFiles, const ParserResourcesType& params); + std::string buildSalomeCouplingScript(const std::string fileToExecute, const std::string dirForTmpFiles, const ParserResourcesType& params); MpiImpl *FactoryMpiImpl(MpiImplType mpiImpl) throw(LauncherException); Batch::BatchManager_eClient *FactoryBatchManager( const ParserResourcesType& params ) throw(LauncherException); std::string getTmpDirForBatchFiles(); diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index 848a21f1d..9211ed82d 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -38,6 +38,7 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am salomeinclude_HEADERS = \ BatchTest.hxx \ SALOME_Launcher.hxx \ + SALOME_Launcher_defs.hxx \ Launcher.hxx # Scripts to be installed @@ -139,6 +140,7 @@ SALOME_LauncherServer_CPPFLAGS=\ SALOME_LauncherServer_LDADD =\ libSalomeLauncher.la \ + ../Basics/libSALOMEBasics.la \ $(MPI_LIBS) \ $(CORBA_LIBS) \ $(LIBXML_LIBS) \ diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index 726091089..a053c8cc5 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -18,13 +18,18 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SALOME_Launcher.hxx" +#include "BatchTest.hxx" #include "OpUtil.hxx" -#include -#ifndef WNT -#include +#include "SALOME_ContainerManager.hxx" +#include "Utils_CorbaException.hxx" + +#ifdef WIN32 +# include +#else +# include #endif +#include #include -#include "Utils_CorbaException.hxx" using namespace std; @@ -97,7 +102,13 @@ void SALOME_Launcher::Shutdown() //============================================================================= CORBA::Long SALOME_Launcher::getPID() { - return (CORBA::Long)getpid(); + return +#ifndef WIN32 + (CORBA::Long)getpid(); +#else + (CORBA::Long)_getpid(); +#endif + } //============================================================================= @@ -172,6 +183,7 @@ SALOME_Launcher::testBatch(const Engines::MachineParameters& params) const Engines::MachineParameters* p = _ResManager->GetMachineParameters((*aMachineList)[0]); string clustername(p->alias); INFOS("Choose cluster" << clustername); + BatchTest t(*p); if (t.test()) { @@ -205,7 +217,7 @@ char* SALOME_Launcher::querySalomeJob( const CORBA::Long jobId, p.mem_mb = params.mem_mb; try{ - status = _l.querySalomeJob(jobId,p); + status = _l.querySalomeJob(jobId,p); } catch(const LauncherException &ex){ INFOS("Caught exception."); diff --git a/src/Launcher/SALOME_Launcher.hxx b/src/Launcher/SALOME_Launcher.hxx index 8ba73cdac..8d59dd53f 100644 --- a/src/Launcher/SALOME_Launcher.hxx +++ b/src/Launcher/SALOME_Launcher.hxx @@ -20,31 +20,19 @@ #ifndef __SALOME_LAUNCHER_HXX__ #define __SALOME_LAUNCHER_HXX__ +#include "SALOME_Launcher_defs.hxx" + #include #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) -#include "SALOME_ContainerManager.hxx" -#include "BatchTest.hxx" #include "Launcher.hxx" #include class SALOME_NamingService; +class SALOME_ContainerManager; +class SALOME_ResourcesManager; -#if defined LAUNCHER_EXPORTS -#if defined WIN32 -#define LAUNCHER_EXPORT __declspec( dllexport ) -#else -#define LAUNCHER_EXPORT -#endif -#else -#if defined WNT -#define LAUNCHER_EXPORT __declspec( dllimport ) -#else -#define LAUNCHER_EXPORT -#endif -#endif - -class LAUNCHER_EXPORT SALOME_Launcher: +class SALOMELAUNCHER_EXPORT SALOME_Launcher: public POA_Engines::SalomeLauncher, public PortableServer::RefCountServantBase { @@ -59,9 +47,9 @@ public: const Engines::BatchParameters& batch_params, const Engines::MachineParameters& params); - char* querySalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params); - void deleteSalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params); - void getResultSalomeJob( const char * directory, const CORBA::Long jobId, const Engines::MachineParameters& params ); + char* querySalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params); + void deleteSalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params); + void getResultSalomeJob( const char * directory, CORBA::Long jobId, const Engines::MachineParameters& params ); CORBA::Boolean testBatch(const Engines::MachineParameters& params); diff --git a/src/Launcher/SALOME_LauncherServer.cxx b/src/Launcher/SALOME_LauncherServer.cxx index a79dc3f91..f0f25f91a 100644 --- a/src/Launcher/SALOME_LauncherServer.cxx +++ b/src/Launcher/SALOME_LauncherServer.cxx @@ -28,6 +28,7 @@ using namespace std; void AttachDebugger() { +#ifndef WIN32 if(getenv ("DEBUGGER")) { std::stringstream exec; @@ -36,6 +37,7 @@ void AttachDebugger() system(exec.str().c_str()); while(1); } +#endif } void terminateHandler(void) diff --git a/src/Launcher/SALOME_Launcher_defs.hxx b/src/Launcher/SALOME_Launcher_defs.hxx new file mode 100755 index 000000000..cc7f196de --- /dev/null +++ b/src/Launcher/SALOME_Launcher_defs.hxx @@ -0,0 +1,33 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +#ifndef __SALOME_LAUNCHER_DEFS_HXX__ +#define __SALOME_LAUNCHER_DEFS_HXX__ + +#ifdef WIN32 +# ifdef SALOMELAUNCHER_EXPORTS +# define SALOMELAUNCHER_EXPORT __declspec(dllexport) +# else +# define SALOMELAUNCHER_EXPORT __declspec(dllimport) +# endif +#else +# define SALOMELAUNCHER_EXPORT +#endif + +#endif //__SALOME_LAUNCHER_DEFS_HXX__ diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 4ce5d8b97..f2edfe0fb 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -26,7 +26,7 @@ #include "SALOME_FileTransferCORBA.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include "utilities.h" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" using namespace std; @@ -146,7 +146,7 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) container = _theFileRef->getContainer(); ASSERT(! CORBA::is_nil(container)); - string myMachine = GetHostname(); + string myMachine = Kernel_Utils::GetHostname(); string localCopy = _theFileRef->getRef(myMachine.c_str()); if (localCopy.empty()) // no existing copy available diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx index c0927d92c..4ac4576c8 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx @@ -34,7 +34,7 @@ #include -#ifdef WNT +#ifdef WIN32 # if defined LIFECYCLECORBA_EXPORTS # define LIFECYCLECORBA_EXPORT __declspec( dllexport ) # else diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 9b399893d..ef14d7cc9 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -32,29 +32,22 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #endif -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include "utilities.h" #include #include "SALOME_LifeCycleCORBA.hxx" -#ifndef WNT #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) #include CORBA_CLIENT_HEADER(SALOME_Session) #include CORBA_CLIENT_HEADER(DSC_Engines) #include CORBA_CLIENT_HEADER(SALOME_Registry) #include CORBA_CLIENT_HEADER(SALOMEDS) -#else -#include "SALOME_ModuleCatalog.hh" -#include "SALOME_Session.hh" -#include "DSC_Engines.hh" -#include "SALOME_Registry.hh" -#include "SALOMEDS.hh" -#endif + #include "SALOME_ContainerManager.hxx" #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" @@ -276,7 +269,7 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, { // containerName doesn't contain "/" => Local container params->container_name=CORBA::string_dup(stContainer); - params->hostname=CORBA::string_dup(GetHostname().c_str()); + params->hostname=CORBA::string_dup(Kernel_Utils::GetHostname().c_str()); } else { @@ -453,7 +446,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() } } - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); // 1) SalomeLauncher CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher"); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index 42e67688d..65ec4e026 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -30,7 +30,7 @@ #define _SALOME_LIFECYCLECORBA_HXX_ #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -40,8 +40,8 @@ #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) #include CORBA_CLIENT_HEADER(SALOME_Component) #include -using namespace std; -#ifdef WNT + +#ifdef WIN32 # if defined LIFECYCLECORBA_EXPORTS # define LIFECYCLECORBA_EXPORT __declspec( dllexport ) # else diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index 7a047fd38..1fc751484 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -23,7 +23,7 @@ #include "SALOME_FileTransferCORBA.hxx" #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include #include @@ -294,7 +294,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_LaunchContainerHostname() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = GetHostname(); + string containerName = Kernel_Utils::GetHostname(); containerName += "/theContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo = @@ -329,7 +329,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameContainer() _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); CPPUNIT_ASSERT(!CORBA::is_nil(mycompo1)); - containerName = GetHostname(); + containerName = Kernel_Utils::GetHostname(); containerName += "/aContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo2 = @@ -441,7 +441,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() Engines::MachineParameters params; _LCC.preSet(params); - string hostname=GetHostname(); + string hostname=Kernel_Utils::GetHostname(); params.hostname=hostname.c_str(); Engines::Component_var mycompo = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); @@ -458,7 +458,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); string hostname1 = c1->getHostName(); - CPPUNIT_ASSERT_EQUAL(hostname1, GetHostname()); + CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); } @@ -492,7 +492,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsContainerName() Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); string hostname1 = c1->getHostName(); - CPPUNIT_ASSERT_EQUAL(hostname1, GetHostname()); + CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); string cname1 = c1->name(); CPPUNIT_ASSERT(cname1.find(containerName) != string::npos); } @@ -621,7 +621,7 @@ void LifeCycleCORBATest::testgetLocalFile_localComputer() SALOME_LifeCycleCORBA _LCC(&_NS); string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0"; - SALOME_FileTransferCORBA transfer( GetHostname(), + SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); @@ -688,7 +688,7 @@ string LifeCycleCORBATest::GetRemoteHost() resourcesManager->GetFittingResources(params,clist); CPPUNIT_ASSERT(hostList->length() > 1); - string localHost = GetHostname(); + string localHost = Kernel_Utils::GetHostname(); string remoteHost; for (unsigned int i=0; i < hostList->length(); i++) { diff --git a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx index 2cd147634..eaf0ba7d8 100644 --- a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx @@ -27,22 +27,17 @@ // $Header$ #include -#ifndef WNT +#ifndef WIN32 #include #endif #include -#ifndef WNT #include CORBA_CLIENT_HEADER(SALOME_Component) #include CORBA_CLIENT_HEADER(SALOME_TestComponent) -#else -#include -#include -#endif #include "SALOME_NamingService.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include "SALOME_FileTransferCORBA.hxx" #include "utilities.h" -#include +#include using namespace std; @@ -108,7 +103,7 @@ int main (int argc, char * argv[]) // --- yet another container, with hostname, // load an engine, and invoque methods on that engine - string containerName4 = GetHostname(); + string containerName4 = Kernel_Utils::GetHostname(); containerName4 += "/titiPy"; Engines::Component_var mycompo4 = _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy"); @@ -120,7 +115,7 @@ int main (int argc, char * argv[]) // --- try a local file transfer string origFileName = "/home/prascle/petitfichier"; - SALOME_FileTransferCORBA transfer( GetHostname(), + SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); string local = transfer.getLocalFile(); SCRUTE(local); diff --git a/src/Logger/SALOME_Logger_Server.cxx b/src/Logger/SALOME_Logger_Server.cxx index 88d33c576..af0bd305d 100644 --- a/src/Logger/SALOME_Logger_Server.cxx +++ b/src/Logger/SALOME_Logger_Server.cxx @@ -16,7 +16,7 @@ # include #endif -#ifdef WNT +#ifdef WIN32 #include #endif diff --git a/src/Logger/SALOME_Logger_Server.hxx b/src/Logger/SALOME_Logger_Server.hxx index 6481eb995..b8450773e 100644 --- a/src/Logger/SALOME_Logger_Server.hxx +++ b/src/Logger/SALOME_Logger_Server.hxx @@ -13,7 +13,7 @@ #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -22,7 +22,7 @@ #include #include "Logger.hh" -#ifdef WNT +#ifdef WIN32 # if defined LOGGER_EXPORTS # define LOGGER_EXPORT __declspec( dllexport ) # else @@ -52,7 +52,7 @@ private: //otherwise all messages will be put into terminal via cout bool m_putIntoFile; //ofstream class specialized for disk file output -#ifndef WNT +#ifndef WIN32 ofstream m_outputFile; #else std::ofstream m_outputFile; diff --git a/src/Logger/SALOME_Logger_Server_main.cxx b/src/Logger/SALOME_Logger_Server_main.cxx index c9551d567..ba0ed2ee5 100644 --- a/src/Logger/SALOME_Logger_Server_main.cxx +++ b/src/Logger/SALOME_Logger_Server_main.cxx @@ -45,7 +45,7 @@ int main(int argc, char **argv) for (i = 1; i <= NumberOfTries; i++) { -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req, &ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index e9b9e4f6e..7e7e254bb 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -16,7 +16,7 @@ #include using namespace std; -#ifdef WNT +#ifdef WIN32 #include #endif @@ -57,7 +57,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { // searchin for naming service for 0.25*40=10 seconds for (i = 1; i <= NumberOfTries; i++) { -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req,&ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); @@ -92,7 +92,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { name[0].id=CORBA::string_dup("Logger"); for(i = 1; i <= NumberOfTries; i++){ -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req, &ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); diff --git a/src/Logger/SALOME_Trace.hxx b/src/Logger/SALOME_Trace.hxx index 24ef7ba8e..f5f9ea6be 100644 --- a/src/Logger/SALOME_Trace.hxx +++ b/src/Logger/SALOME_Trace.hxx @@ -16,7 +16,7 @@ #include "Logger.hh" //these declarations for files don't using OCC includes (for example HDF) -# ifdef WNT +# ifdef WIN32 # ifndef Standard_EXPORT # define Standard_EXPORT __declspec( dllexport ) @@ -30,7 +30,7 @@ # define Standard_IMPORTC extern "C" __declspec( dllimport ) # endif /* Standard_IMPORT */ -# else /* WNT */ +# else /* WIN32 */ # ifndef Standard_EXPORT # define Standard_EXPORT @@ -44,7 +44,7 @@ # define Standard_IMPORTC extern "C" # endif /* Standard_IMPORT */ -# endif /* WNT */ +# endif /* WIN32 */ class SALOME_Trace : public std::ostrstream { diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index 926a16763..287edee53 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -76,7 +76,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, CORBA::Object_var obj=_poa->id_to_reference(*_id); Engines::Container_var pCont = Engines::Container::_narrow(obj); - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str()); SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str());