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.
std::cout << "----Cst ---- InternalDataIdContainer(const DataId & dataId..) " << dataId <<std::endl;
policy.filtre_convert_TIME.applique_filtre_conversion(dataId.first, _lTime);
int c=0;
- for(vector<CORBA::Long>::iterator i=_lTime.begin();i!=_lTime.end();++i)
+ for(std::vector<CORBA::Long>::iterator i=_lTime.begin();i!=_lTime.end();++i)
std::cout << "_lTime["<< c++ << "] : " << *i << std::endl;
policy.filtre_convert_TAG.applique_filtre_conversion(dataId.second, _lTag);
c=0;
- for(vector<CORBA::Long>::iterator i=_lTag.begin();i!=_lTag.end();++i)
+ for(std::vector<CORBA::Long>::iterator i=_lTag.begin();i!=_lTag.end();++i)
std::cout << "_lTag["<< c++ << "] : " << *i << std::endl;
}
#include "palm_port_factory.hxx"
+using namespace std;
+
palm_port_factory::palm_port_factory() {
}
#include "palm_data_short_port_provides.hxx"
#include "palm_data_seq_short_port_provides.hxx"
-using namespace std;
-
class palm_port_factory :
public port_factory
{
palm_port_factory();
virtual ~palm_port_factory();
- virtual provides_port * create_data_servant(string type);
- virtual uses_port * create_data_proxy(string type);
+ virtual provides_port * create_data_servant(std::string type);
+ virtual uses_port * create_data_proxy(std::string type);
};
#endif
#ifndef _SALOME_NOTIFICATION_HXX_
#define _SALOME_NOTIFICATION_HXX_
-#ifdef WNT
- #if defined NOTIFICATION_EXPORTS
- #if defined WIN32
- #define NOTIFICATION_EXPORT __declspec( dllexport )
- #else
- #define NOTIFICATION_EXPORT
- #endif
- #else
- #if defined WIN32
- #define NOTIFICATION_EXPORT __declspec( dllimport )
- #else
- #define NOTIFICATION_EXPORT
- #endif
- #endif
+#ifdef WIN32
+# ifdef NOTIFICATION_EXPORTS
+# define NOTIFICATION_EXPORT __declspec( dllexport )
+# else
+# define NOTIFICATION_EXPORT __declspec( dllimport )
+# endif
#else
- #define NOTIFICATION_EXPORT
+# define NOTIFICATION_EXPORT
#endif
#endif
#include "SALOMEDS_Tool.hxx"
#include "utilities.h"
+#include "Basics_DirUtils.hxx"
-#ifndef WNT
+#ifndef WIN32
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <iostream.h>
-#include <fstream.h>
#include <pwd.h>
#include <unistd.h>
#else
#include <lmcons.h>
#endif
+#include <iostream>
+#include <fstream>
#include <stdlib.h>
#include <SALOMEconfig.h>
bool Exists(const string thePath)
{
-#ifdef WNT
+#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
- if ( GetLastError () != ERROR_FILE_NOT_FOUND ) {
+ if ( GetLastError () == ERROR_FILE_NOT_FOUND ) {
return false;
}
}
//============================================================================
std::string SALOMEDS_Tool::GetTmpDir()
{
+ return Kernel_Utils::GetTmpDirByEnv("SALOME_TMP_DIR");
//Find a temporary directory to store a file
- string aTmpDir = "";
+ /*string aTmpDir = "";
char *Tmp_dir = getenv("SALOME_TMP_DIR");
if(Tmp_dir != NULL) {
#endif
-#ifdef WNT
+#ifdef WIN32
CreateDirectory(aDir.c_str(), NULL);
#else
mkdir(aDir.c_str(), 0x1ff);
#endif
- return aDir;
+ return aDir;*/
}
//============================================================================
aFile += theFiles[i-1];
if(!Exists(aFile)) continue;
-#ifdef WNT
+#ifdef WIN32
DeleteFile(aFile.c_str());
#else
unlink(aFile.c_str());
if(IsDirDeleted) {
if(Exists(aDirName)) {
-#ifdef WNT
- RemoveDirectory(aDireName.c_str());
+#ifdef WIN32
+ RemoveDirectory(aDirName.c_str());
#else
rmdir(aDirName.c_str());
#endif
if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
if(!Exists(aFullPath)) continue;
-#ifdef WNT
+#ifdef WIN32
ifstream aFile(aFullPath.c_str(), ios::binary);
#else
ifstream aFile(aFullPath.c_str());
if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
if(!Exists(aFullPath)) continue;
-#ifdef WNT
+#ifdef WIN32
aFile = new ifstream(aFullPath.c_str(), ios::binary);
#else
aFile = new ifstream(aFullPath.c_str());
aCurrentPos += 8;
string aFullPath = aTmpDir + aFileName;
-#ifdef WNT
+#ifdef WIN32
ofstream aFile(aFullPath.c_str(), ios::binary);
#else
ofstream aFile(aFullPath.c_str());
path = thePath+"/";
}
-#ifdef WNT //Check if the only disk letter is given as path
- if(path.size() == 2 && path[1] == ":") path +='\\';
+#ifdef WIN32 //Check if the only disk letter is given as path
+ if(path.size() == 2 && path[1] == ':') path +='\\';
#endif
for(int i = 0, len = path.size(); i<len; i++)
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(SALOMEDS)
-#ifdef WNT
- #if defined TOOLSDS_EXPORTS
- #if defined WIN32
- #define TOOLSDS_EXPORT __declspec( dllexport )
- #else
- #define TOOLSDS_EXPORT
- #endif
- #else
- #if defined WIN32
- #define TOOLSDS_EXPORT __declspec( dllimport )
- #else
- #define TOOLSDS_EXPORT
- #endif
- #endif
+#ifdef WIN32
+# ifdef TOOLSDS_EXPORTS
+# define TOOLSDS_EXPORT __declspec( dllexport )
+# else
+# define TOOLSDS_EXPORT __declspec( dllimport )
+# endif
#else
- #define TOOLSDS_EXPORT
+# define TOOLSDS_EXPORT
#endif
class TOOLSDS_EXPORT SALOMEDS_Tool
public:
// Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set
- // otherwise return /tmp/something/ for Unix or c:\something\ for WNT
+ // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
static std::string GetTmpDir();
TestContainer_SOURCES = TestContainer.cxx
TestContainer_CPPFLAGS = $(COMMON_CPPFLAGS)
TestContainer_LDADD = libSalomeTestComponentEngine.la \
+ ../Basics/libSALOMEBasics.la \
$(CORBA_LIBS)
TestLogger_SOURCES = TestLogger.cxx
TestLogger_CPPFLAGS = $(COMMON_CPPFLAGS)
TestLogger_LDADD = libSalomeTestComponentEngine.la \
+ ../Basics/libSALOMEBasics.la \
$(CORBA_LIBS)
// Module : SALOME
// $Header$
-#ifndef WNT
+#ifndef WIN32
# define private protected
#endif
#include "utilities.h"
#include "SALOME_NamingService.hxx"
#include "NamingService_WaitForServerReadiness.hxx"
-#include "OpUtil.hxx"
+#include "Basics_Utils.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "Utils_SALOME_Exception.hxx"
{
SALOME_NamingService _NS(orb) ;
string containerName = "/Containers/" ;
- string hostName = GetHostname();
+ string hostName = Kernel_Utils::GetHostname();
containerName += hostName + "/FactoryServer";
NamingService_WaitForServerReadiness(&_NS,containerName);
// Use Name Service to find container
SALOME_NamingService NS(orb) ;
string containerName = "/Containers/" ;
- string hostName = GetHostname();
+ string hostName = Kernel_Utils::GetHostname();
containerName += hostName + "/MPIFactoryServer_" + argv[2];
string dirn(getenv("KERNEL_ROOT_DIR"));
# Libraries targets
lib_LTLIBRARIES = libOpUtil.la
libOpUtil_la_SOURCES =\
- OpUtil.cxx Utils_Timer.cxx duplicate.cxx \
+ Utils_Timer.cxx \
+ duplicate.cxx \
Utils_CommException.cxx \
Utils_SALOME_Exception.cxx \
Utils_Identity.cxx Utils_ORB_INIT.cxx \
#ifndef _OPUTIL_HXX
#define _OPUTIL_HXX
-#include <SALOME_Utils.hxx>
+#include "SALOME_Utils.hxx"
-#include <string>
-
-UTILS_EXPORT std::string GetHostname();
UTILS_EXPORT const char *duplicate(const char * const);
#endif
#ifndef _SALOME_UTILS_HXX_
#define _SALOME_UTILS_HXX_
-#ifdef WNT
+#ifdef WIN32
# if defined UTILS_EXPORTS
# define UTILS_EXPORT __declspec( dllexport )
# else
#ifndef Utils_ExceptHandlers_HeaderFile
#define Utils_ExceptHandlers_HeaderFile
-#include <SALOME_Utils.hxx>
+#include "SALOME_Utils.hxx"
#include <stdexcept>
class UTILS_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment
PVF old;
public :
-#ifndef WNT
+#ifndef WIN32
Unexpect( PVF f )
{ old = std::set_unexpected(f); }
~Unexpect() { std::set_unexpected(old); }
PVF old;
public :
-#ifndef WNT
+#ifndef WIN32
Terminate( PVF f )
{ old = std::set_terminate(f); }
~Terminate() { std::set_terminate(old); }
{
# include <string.h>
-#ifndef WNT /* unix functionality */
+#ifndef WIN32 /* unix functionality */
# include <pwd.h>
#endif
}
-#ifndef WNT /* unix functionality */
+#ifndef WIN32 /* unix functionality */
# include <arpa/inet.h>
# include <netinet/in.h>
#define getcwd _getcwd
#define getpid _getpid
-#endif /* WNT */
+#endif /* WIN32 */
Identity::Identity( const char *name ): _name(duplicate(name)),\
{
return _name ;
}
-#ifndef WNT
+#ifndef WIN32
const pid_t& Identity::pid(void) const
#else
const DWORD& Identity::pid(void) const
return _pid ;
}
-#ifndef WNT
+#ifndef WIN32
const struct utsname &Identity::hostid(void) const
#else
const char* const Identity::hostid(void) const
return _hostid ;
}
-#ifndef WNT
+#ifndef WIN32
const uid_t& Identity::uid(void) const
#else
const PSID& Identity::uid(void) const
const char* Identity::host_char( void ) const
{
-#ifndef WNT
+#ifndef WIN32
return _hostid.nodename;
#else
return _hostid;
os << '\t' << "Numero de PID : " << monid._pid << std::endl;
os << '\t' << "Uid utilisateur : " << monid._uid << std::endl;
os << '\t' << "nom utilisateur : " << monid._pwname << std::endl;
-#ifndef WNT
+#ifndef WIN32
os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl;
#else
os << '\t' << "Nom de machine : " << monid._hostid << std::endl;
{
# include <stdlib.h>
# include <time.h>
-#ifndef WNT
+#ifndef WIN32
# include <unistd.h>
# include <sys/utsname.h>
#else
const char* const _name ;
const char* const _adip; // Internet address
-#ifndef WNT
+#ifndef WIN32
const struct utsname _hostid;
const pid_t _pid ;
const uid_t _uid ;
~Identity();
friend std::ostream & operator<< ( std::ostream& os , const Identity& monid );
-#ifndef WNT
+#ifndef WIN32
const pid_t& pid(void) const;
const struct utsname& hostid(void) const;
const uid_t& uid(void) const;
{
pthread_mutex_lock( &myHelperMutex );
-#ifndef WNT
+#ifndef WIN32
if ( myCount > 0 && myThread == pthread_self() ) {
#else
if ( myCount > 0 && myThread.p == pthread_self().p ) {
{
pthread_mutex_lock( &myHelperMutex );
-#ifndef WNT
+#ifndef WIN32
if ( myThread == pthread_self() ) {
#else
if ( myThread.p == pthread_self().p ) {
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-#ifndef WNT
+#ifndef WIN32
extern "C"
{
#endif
#include <math.h>
#include <stdio.h>
#include <string.h>
-#ifndef WNT
+#ifndef WIN32
}
#endif
//swig tool on Linux doesn't pass defines from header SALOME_Utils.hxx
//therefore (temporary solution) defines are placed below
-#ifdef WNT
-# if defined UTILS_EXPORTS
+#ifdef WIN32
+# ifdef UTILS_EXPORTS
# define UTILS_EXPORT __declspec( dllexport )
# else
# define UTILS_EXPORT __declspec( dllimport )
#include "utilities.h"
-#ifndef WNT
+#ifndef WIN32
static struct timezone *tz=(struct timezone*) malloc(sizeof(struct timezone));
#else
//timezone *tz=_timezone;
#endif
Utils_Timer::Utils_Timer() {
-#ifndef WNT
+#ifndef WIN32
RefToInitialTMS = new tms;
RefToCurrentTMS = new tms;
void Utils_Timer::Start() {
if (Stopped) {
Stopped = 0;
-#ifndef WNT
+#ifndef WIN32
times(RefToInitialTMS);
gettimeofday(RefToInitialTimeB,tz);
#else
void Utils_Timer::Stop() {
if (!Stopped) {
-#ifndef WNT
+#ifndef WIN32
times(RefToCurrentTMS);
int diffr_user = RefToCurrentTMS->tms_utime - RefToInitialTMS->tms_utime;
int diffr_sys = RefToCurrentTMS->tms_stime - RefToInitialTMS->tms_stime;
void Utils_Timer::ShowAbsolute(){
#if defined(_DEBUG_) || defined(_DEBUG)
-#ifndef WNT
+#ifndef WIN32
unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ;
#else
unsigned long Absolute_user = *RefToCurrentTimeB;
#include <stdlib.h>
#include <time.h>
-#ifndef WNT
+#ifndef WIN32
# include <sys/times.h>
# include <sys/time.h>
# include <unistd.h>
double Cumul_user;
double Cumul_sys;
bool Stopped;
-#ifndef WNT
+#ifndef WIN32
tms *RefToCurrentTMS, *RefToInitialTMS;
timeval *RefToCurrentTimeB, *RefToInitialTimeB;
#else