]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Win32 Porting.
authorabd <abd@opencascade.com>
Fri, 3 Oct 2008 09:37:12 +0000 (09:37 +0000)
committerabd <abd@opencascade.com>
Fri, 3 Oct 2008 09:37:12 +0000 (09:37 +0000)
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.

21 files changed:
src/Launcher/BatchTest.cxx
src/Launcher/BatchTest.hxx
src/Launcher/Launcher.cxx
src/Launcher/Launcher.hxx
src/Launcher/Makefile.am
src/Launcher/SALOME_Launcher.cxx
src/Launcher/SALOME_Launcher.hxx
src/Launcher/SALOME_LauncherServer.cxx
src/Launcher/SALOME_Launcher_defs.hxx [new file with mode: 0755]
src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx
src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx
src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx
src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx
src/Logger/SALOME_Logger_Server.cxx
src/Logger/SALOME_Logger_Server.hxx
src/Logger/SALOME_Logger_Server_main.cxx
src/Logger/SALOME_Trace.cxx
src/Logger/SALOME_Trace.hxx
src/MPIContainer/MPIContainer_i.cxx

index bb44166f49677e5911f19099758ec8e17a70bc38..c51301490832253c7344fb119dda68eb0c3bbab8 100644 (file)
@@ -1,5 +1,15 @@
 #include "BatchTest.hxx"
 
+#include "Batch_Date.hxx"
+#include "MpiImpl.hxx"
+#include "utilities.h"
+
+#include <sys/stat.h>
+#include <iostream>
+#include <fstream>
+#ifdef WIN32
+# include <io.h>
+#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 
index 600b71beeeeda18c8cff4493d4b6f303995f608f..da32b1db3b3fc321f425bf69f2bc82138a3533d4 100644 (file)
 #ifndef __BatchTest_HXX__
 #define __BatchTest_HXX__
 
-#include <sys/stat.h>
-#include <iostream>
-#include <fstream>
+#include "SALOME_Launcher_defs.hxx"
 
 #include <SALOMEconfig.h>
-#include "utilities.h"
 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
 
-#include "Batch_Date.hxx"
-#include "MpiImpl.hxx"
+#include <string>
 
-class BatchTest 
+class SALOMELAUNCHER_EXPORT BatchTest 
 {
   public:
     BatchTest(const Engines::MachineParameters& batch_descr);
index 9f9f3904d9d2a8a868d3d90ab0f30ea710ea6111..589ec566f190129d9b9d01f6e208f8cfaa19d0e1 100644 (file)
 //
 // 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 <iostream>
 #include <sstream>
 #include <sys/stat.h>
@@ -156,7 +160,7 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute ,
     istringstream iss(jid.getReference());
     iss >> jobId;
 
-    _jobmap[ pair<string,long>(clustername,jobId) ] = job;
+    _jobmap[ pair<string,long>(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;
     }
index 84dd59dd57602c5e4ad69ff0fa775ead72d02e6c..fdf3eba54e024bdc0fe5cbf4bcc203dcc878cfbb 100644 (file)
 #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 <SALOME_ResourcesCatalog_Parser.hxx>
 #include "ResourcesManager.hxx"
 
 #include <string>
+#include <vector>
+
+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();
index 848a21f1d2a9801bf6c9d28b3b30f11673a9a3f7..9211ed82df3c012ae6ad0720def25eacb40a9122 100644 (file)
@@ -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) \
index 726091089aa09d13202602d514dfeb398aa3459b..a053c8cc53c866a1f4206e15a08d75679a96e0f2 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SALOME_Launcher.hxx"
+#include "BatchTest.hxx"
 #include "OpUtil.hxx"
-#include <sys/types.h>
-#ifndef WNT
-#include <unistd.h>
+#include "SALOME_ContainerManager.hxx"
+#include "Utils_CorbaException.hxx"
+
+#ifdef WIN32
+# include <process.h>
+#else
+# include <unistd.h>
 #endif
+#include <sys/types.h>
 #include <vector>
-#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.");
index 8ba73cdac53c62fab499481866319a9e2464d4a3..8d59dd53f2325a4655f7aa77fc11b1a789a5c7cd 100644 (file)
 #ifndef __SALOME_LAUNCHER_HXX__
 #define __SALOME_LAUNCHER_HXX__
 
+#include "SALOME_Launcher_defs.hxx"
+
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
-#include "SALOME_ContainerManager.hxx"
-#include "BatchTest.hxx"
 #include "Launcher.hxx"
 
 #include <string>
 
 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);
 
index a79dc3f91517da6ab75888978d52fa1cad97e8b3..f0f25f91aa7e332844b41c3feb20110c7dc8d7b9 100644 (file)
@@ -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 (executable)
index 0000000..cc7f196
--- /dev/null
@@ -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__
index 4ce5d8b973534c46fcf0fe47aece27f16d543b35..f2edfe0fb3e43fc4d45560bc67369c70cd4a3408 100644 (file)
@@ -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
index c0927d92cde5d73a80beb457880a8f21ef5328f8..4ac4576c80dc6c7892550273906f310bed40f3fe 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <string>
 
-#ifdef WNT
+#ifdef WIN32
 # if defined LIFECYCLECORBA_EXPORTS
 #  define LIFECYCLECORBA_EXPORT __declspec( dllexport )
 # else
index 9b399893d0ae808959e72bf6994f99804b6a8f9a..ef14d7cc9744609d9e12a3c8d7678459408dfab5 100644 (file)
 #include <iomanip>
 
 #include <time.h>
-#ifndef WNT
+#ifndef WIN32
   #include <sys/time.h>
 #endif
 
-#include "OpUtil.hxx"
+#include "Basics_Utils.hxx"
 #include "utilities.h"
 
 #include <ServiceUnreachable.hxx>
 
 #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");
index 42e67688df4c23742940de4dc031768491c4d6a6..65ec4e0268bb07b1774b52eee8142d0ab6dd7da4 100644 (file)
@@ -30,7 +30,7 @@
 #define _SALOME_LIFECYCLECORBA_HXX_
 
 #include <stdlib.h>
-#ifndef WNT
+#ifndef WIN32
 #include <unistd.h>
 #endif
 #include <string>
@@ -40,8 +40,8 @@
 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 #include <iostream>
-using namespace std;
-#ifdef WNT
+
+#ifdef WIN32
 # if defined LIFECYCLECORBA_EXPORTS
 #  define LIFECYCLECORBA_EXPORT __declspec( dllexport )
 # else
index 7a047fd388967eaab2ab1f7bed5ce46402696bb1..1fc7514846a77f0d740e1d07aa8884841bc764cd 100644 (file)
@@ -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 <iostream>
 #include <fstream>
@@ -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++)
     {
index 2cd14763498cb9d5a2cd726ca109b02b332e7e87..eaf0ba7d81c3ca208419632de2bfd1ebc60d471c 100644 (file)
 //  $Header$
 
 #include <iostream>
-#ifndef WNT
+#ifndef WIN32
 #include <unistd.h>
 #endif
 #include <SALOMEconfig.h>
-#ifndef WNT
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 #include CORBA_CLIENT_HEADER(SALOME_TestComponent)
-#else
-#include <SALOME_Component.hh>
-#include <SALOME_TestComponent.hh>
-#endif
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 #include "SALOME_FileTransferCORBA.hxx"
 #include "utilities.h"
-#include <OpUtil.hxx>
+#include <Basics_Utils.hxx>
 
 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);
index 88d33c5766ca243568d14f79def9cd8b915ad59d..af0bd305da0b5d94200f77ed9ea1c94e7cd952d0 100644 (file)
@@ -16,7 +16,7 @@
 # include <unistd.h>
 #endif
 
-#ifdef WNT
+#ifdef WIN32
 #include <omnithread/pthread_nt.h>
 #endif
 
index 6481eb9956a3d9627fb4501b4b76b216118ab2c1..b8450773e4b094011b39f525855c9079b1654a3b 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <SALOMEconfig.h>
 
-#ifndef WNT
+#ifndef WIN32
 #include <fstream.h>
 #else
 #include <fstream>
@@ -22,7 +22,7 @@
 #include <omnithread.h>
 #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; 
index c9551d567919d0f9586c9e22f758530bbb31c44f..ba0ed2ee5fcfd4415c786337bc872c278fe2e49f 100644 (file)
@@ -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);
index e9b9e4f6eef2aab4bd1003a5d809ad583c2066ac..7e7e254bba412b90b83047feb092843772681e03 100644 (file)
@@ -16,7 +16,7 @@
 #include <iostream>
 using namespace std;
 
-#ifdef WNT
+#ifdef WIN32
 #include <omnithread/pthread_nt.h>
 #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);
index 24ef7ba8e72e9fac94c7846178fc5b3c293fa423..f5f9ea6bee07068283fcd030427407d00166f30d 100644 (file)
@@ -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  
 {
index 926a1676373ac0c6d892946685c1b786022bf8b3..287edee53e45cc022cb7bba789ada15bf48e438d 100644 (file)
@@ -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());