From dd54983c231711ace475a930681e471b542c1dc2 Mon Sep 17 00:00:00 2001 From: stv Date: Mon, 20 Feb 2006 08:13:48 +0000 Subject: [PATCH] Updated SALOME Kernel sources for building under Ms Visual .NET on Windows platform. --- src/Container/Container_i.cxx | 39 ++++++++++++++++++------------ src/HDFPersist/HDFascii.cc | 7 ++---- src/HDFPersist/HDFattrGetSize.c | 7 +++--- src/HDFPersist/HDFobjectIdentify.c | 4 +-- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 48b3ac787..82f63facd 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -45,7 +45,7 @@ #include #include #else -#include "../../adm/win32/SALOME_WNT.hxx" +#include #include #include int SIGUSR1 = 1000; @@ -306,23 +306,26 @@ Engines_Container_i::load_component_Library(const char* componentName) return true; } - void* handle; #ifndef WNT + void* handle; handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else - handle = dlopen( impl_name.c_str() , 0 ) ; + HINSTANCE handle; + handle = LoadLibrary( impl_name.c_str() ); #endif if ( handle ) - { + { _library_map[impl_name] = handle; _numInstanceMutex.unlock(); return true; - } + } else - { - INFOS("Can't load shared library : " << impl_name); + { + INFOS( "Can't load shared library: " << impl_name ); +#ifndef WNT INFOS("error dlopen: " << dlerror()); - } +#endif + } _numInstanceMutex.unlock(); // --- try import Python component @@ -690,16 +693,20 @@ Engines_Container_i::createInstance(string genericRegisterName, const char *, const char *) ; - FACTORY_FUNCTION Component_factory - = (FACTORY_FUNCTION) dlsym(handle, factory_name.c_str()); +#ifndef WNT + FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION)dlsym( handle, factory_name.c_str() ); +#else + FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION)GetProcAddress( (HINSTANCE)handle, factory_name.c_str() ); +#endif - char *error ; - if ( (error = dlerror() ) != NULL) - { - INFOS("Can't resolve symbol: " + factory_name); - SCRUTE(error); + if ( !Component_factory ) + { + INFOS( "Can't resolve symbol: " + factory_name ); +#ifndef WNT + SCRUTE( dlerror() ); +#endif return Engines::Component::_nil() ; - } + } // --- create instance diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 1e0ee9f80..1cd9d815e 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -316,11 +316,8 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) fprintf(fp, "\n"); -#ifndef WNT - for(unsigned j=0; jGetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset); delete name; diff --git a/src/HDFPersist/HDFattrGetSize.c b/src/HDFPersist/HDFattrGetSize.c index 0d08093da..785818653 100644 --- a/src/HDFPersist/HDFattrGetSize.c +++ b/src/HDFPersist/HDFattrGetSize.c @@ -29,16 +29,15 @@ Module : SALOME #include "hdfi.h" #include -hdf_type -HDFattrGetSize(hdf_idt id) +hdf_type HDFattrGetSize( hdf_idt id ) { + hdf_type ret; hdf_idt type_id; - int ret; if ((type_id = H5Aget_type(id)) < 0) return HDF_NONE; - ret = H5Tget_size(type_id); + ret = (hdf_type)H5Tget_size(type_id); H5Tclose(type_id); diff --git a/src/HDFPersist/HDFobjectIdentify.c b/src/HDFPersist/HDFobjectIdentify.c index 87de66c64..9fb602279 100644 --- a/src/HDFPersist/HDFobjectIdentify.c +++ b/src/HDFPersist/HDFobjectIdentify.c @@ -58,8 +58,8 @@ hdf_err HDFobjectIdentify(hdf_idt fid,char *path,int i,char *name) hdf_err RankInfo(hdf_idt id, const char *name, void *data) { - if (data != NULL) - strcpy(data,name); + if ( data ) + strcpy( (char*)data, name ); else return -1; -- 2.39.2