From: abd Date: Fri, 3 Oct 2008 10:07:23 +0000 (+0000) Subject: Win32 Porting. X-Git-Tag: RELIQUAT_4x_25102008~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=473f6a09d68ba04ac8ad66414cff06852c9e2a5a;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/NamingService/Makefile.am b/src/NamingService/Makefile.am index a371d7e1c..3717f4377 100644 --- a/src/NamingService/Makefile.am +++ b/src/NamingService/Makefile.am @@ -32,7 +32,8 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am salomeinclude_HEADERS =\ SALOME_NamingService.hxx \ ServiceUnreachable.hxx \ - NamingService_WaitForServerReadiness.hxx + NamingService_WaitForServerReadiness.hxx \ + SALOME_NamingService_defs.hxx # Scripts to be exported dist_salomescript_DATA =\ diff --git a/src/NamingService/NamingService_WaitForServerReadiness.cxx b/src/NamingService/NamingService_WaitForServerReadiness.cxx index d4eb2aa7e..0cdc78ad5 100644 --- a/src/NamingService/NamingService_WaitForServerReadiness.cxx +++ b/src/NamingService/NamingService_WaitForServerReadiness.cxx @@ -79,7 +79,7 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, break; // server found, no more try to do } MESSAGE("Server "<< serverName <<" not yet ready, waiting..."); -#ifndef WNT +#ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); @@ -89,7 +89,7 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, catch( ServiceUnreachable& ) { MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting..."); -#ifndef WNT +#ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index 57e53ab75..ce23e360e 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -39,19 +39,7 @@ #include "Utils_Mutex.hxx" #include "ServiceUnreachable.hxx" -#if defined NAMINGSERVICE_EXPORTS -#if defined WIN32 -#define NAMINGSERVICE_EXPORT __declspec( dllexport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#else -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllimport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#endif +#include "SALOME_NamingService_defs.hxx" class NAMINGSERVICE_EXPORT SALOME_NamingService { diff --git a/src/NamingService/SALOME_NamingService_defs.hxx b/src/NamingService/SALOME_NamingService_defs.hxx new file mode 100644 index 000000000..7119c3cc7 --- /dev/null +++ b/src/NamingService/SALOME_NamingService_defs.hxx @@ -0,0 +1,42 @@ +// SALOME NamingService : wrapping NamingService services +// +// Copyright (C) 2003 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 +// +// +// +// File : SALOME_NamingService_defs.hxx +// Author : Alexander A. BORODIN +// Module : SALOME +// $Header$ + +#ifndef SALOME_NAMINGSERVICE_DEFS_HXX +#define SALOME_NAMINGSERVICE_DEFS_HXX + +#ifdef WIN32 +# ifdef NAMINGSERVICE_EXPORTS +# define NAMINGSERVICE_EXPORT __declspec( dllexport ) +# else +# define NAMINGSERVICE_EXPORT __declspec( dllimport ) +# endif +#else +# define NAMINGSERVICE_EXPORT +#endif + +#endif //SALOME_NAMINGSERVICE_DEFS_HXX \ No newline at end of file diff --git a/src/NamingService/ServiceUnreachable.hxx b/src/NamingService/ServiceUnreachable.hxx index 496f376fe..14ffae697 100644 --- a/src/NamingService/ServiceUnreachable.hxx +++ b/src/NamingService/ServiceUnreachable.hxx @@ -29,20 +29,7 @@ #if !defined ( SERVICEUNREACHABLE_H ) #define SERVICEUNREACHABLE_H -#if defined NAMINGSERVICE_EXPORTS -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllexport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#else -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllimport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#endif - +#include "SALOME_NamingService_defs.hxx" #include "Utils_SALOME_Exception.hxx" //! exception class for NamingService : ServiceUnreachable