From 29f7064ed0054b39d0457ee6e0093e85e8479c4d Mon Sep 17 00:00:00 2001 From: agibert Date: Wed, 19 Jan 2005 23:59:41 +0000 Subject: [PATCH] Re-enable Win32 support. Rename _MSCVER #ifdef into _WIN32 #ifdef. --- lib/libnode.c | 50 +++++++++++++++++++++++++++++++++++++++++++------- lib/libnode.h | 6 +++--- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/lib/libnode.c b/lib/libnode.c index 6fb7cf2..cb7b109 100644 --- a/lib/libnode.c +++ b/lib/libnode.c @@ -1,9 +1,9 @@ /*---------------------------------------------------------------------------------*/ /* $RCSfile: libnode.c,v $ */ /*---------------------------------------------------------------------------------*/ -/* $Revision: 2.14 $ */ +/* $Revision: 2.15 $ */ /* $Name: $ */ -/* $Date: 2005/01/11 20:57:04 $ */ +/* $Date: 2005/01/19 23:59:41 $ */ /* $Author: agibert $ */ /*---------------------------------------------------------------------------------*/ @@ -34,7 +34,7 @@ #include #ifdef _LIBVER_SUPPORT -VER_INFO_EXPORT( libnode, "$Revision: 2.14 $", "$Name: $", __FILE__, "$Author: agibert $") +VER_INFO_EXPORT( libnode, "$Revision: 2.15 $", "$Name: $", __FILE__, "$Author: agibert $") #endif @@ -63,7 +63,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT Command_Name = "NDD_CMD_MANAGER_VERSION"; - *Version_Name_Ptr = "$Revision: 2.14 $ $Name: $ $Date: 2005/01/11 20:57:04 $ $Author: agibert $"; + *Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $"; return( NDS_OK); } @@ -369,7 +369,7 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, Command_Name = "NDD_CMD_MANAGER_VERSION"; - *Version_Name_Ptr = "$Revision: 2.14 $ $Name: $ $Date: 2005/01/11 20:57:04 $ $Author: agibert $"; + *Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $"; return( NDS_OK); } @@ -604,6 +604,7 @@ NDT_Status ND_Library_Open_I( int Debug_Mode) ND_Library_StdErr_Set_I( stderr); } +#if !defined(_WIN32) if( ( NDG_Base.DL_Ptr = dlopen( NULL, ( RTLD_NOW | RTLD_GLOBAL))) == NULL) { sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlopen [%s]", dlerror()); @@ -611,6 +612,7 @@ NDT_Status ND_Library_Open_I( int Debug_Mode) return( NDS_KO); } +#endif return( NDS_OK); } @@ -679,6 +681,7 @@ NDT_Status ND_Library_Close_I( void) NDG_Base.Symbol_First_Ptr = (NDT_Symbol *)NULL; +#if !defined(_WIN32) if( dlclose( NDG_Base.DL_Ptr) != 0) { sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlclose [%s]", dlerror()); @@ -686,6 +689,7 @@ NDT_Status ND_Library_Close_I( void) return( NDS_KO); } +#endif NDG_Base.Open_Status = NDD_FALSE; @@ -928,6 +932,16 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N /* Valeurs par défaut des fonctions d'allocation et de désallocation */ +#if defined(_WIN32) + if( ( Manager_Name != NULL) && ( Manager_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Manager_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + if( ( Manager_Name != NULL) || ( Manager_Ptr != NULL)) { Real_Manager_Name = Manager_Name; @@ -939,6 +953,16 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N Real_Manager_Ptr = ND_Default_Manager; } +#if defined(_WIN32) + if( ( Allocator_Name != NULL) && ( Allocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Allocator_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + if( ( Allocator_Name != NULL) || ( Allocator_Ptr != NULL)) { Real_Allocator_Name = Allocator_Name; @@ -950,6 +974,16 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N Real_Allocator_Ptr = ND_Default_Allocator; } +#if defined(_WIN32) + if( ( Desallocator_Name != NULL) && ( Desallocator_Ptr == NULL)) + { + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Desallocator_Ptr shouldn't be NULL"); + ND_Error_Print(); + + return( NDS_ERRAPI); + } +#endif + if( ( Desallocator_Name != NULL) || ( Desallocator_Ptr != NULL)) { Real_Desallocator_Name = Desallocator_Name; @@ -4119,6 +4153,7 @@ NDT_Status ND_Desallocator_Exec_C( void *Ptr, NDT_Desallocator_Name Desallocat NDT_Status ND_Symbol_Find( void **Ptr_Ptr, const char *Symbol_Name) { +#if !defined(_WIN32) NDT_Symbol *Symbol_Ptr; @@ -4166,6 +4201,7 @@ NDT_Status ND_Symbol_Find( void **Ptr_Ptr, const char *Symbol_Name) NDG_Base.Symbol_First_Ptr = Symbol_Ptr; } +#endif return( NDS_OK); } @@ -5619,7 +5655,7 @@ void ND_Tree_Link_Recursive_Check( NDT_Node *Node_Ptr, int *Nb_Detected_Ptr, NDT_Status ND_Address_Check( void *Address) { -#if !defined(_MSC_VER) +#if !defined(_WIN32) NDT_Status status; int rc; int test; @@ -5748,7 +5784,7 @@ void ND_Signal_Trap( int Sig_Num) { NDG_Base.Sig_Trapped = Sig_Num; -#if !defined(_MSC_VER) +#if !defined(_WIN32) siglongjmp( NDG_Base.SigLongJmp_Env, 1); #else longjmp( NDG_Base.SigLongJmp_Env, 1); diff --git a/lib/libnode.h b/lib/libnode.h index ba6882d..5e1dfd9 100644 --- a/lib/libnode.h +++ b/lib/libnode.h @@ -1,9 +1,9 @@ /*---------------------------------------------------------------------------------*/ /* $RCSfile: libnode.h,v $ */ /*---------------------------------------------------------------------------------*/ -/* $Revision: 2.8 $ */ +/* $Revision: 2.9 $ */ /* $Name: $ */ -/* $Date: 2005/01/11 20:57:04 $ */ +/* $Date: 2005/01/19 23:59:42 $ */ /* $Author: agibert $ */ /*---------------------------------------------------------------------------------*/ @@ -87,7 +87,7 @@ typedef struct NDT_Base char Err_String[512]; FILE *Err_Stream; int Sig_Trapped; -#if !defined(_MSC_VER) +#if !defined(_WIN32) sigjmp_buf SigLongJmp_Env; #else jmp_buf SigLongJmp_Env;