1 /*=========================================================================
4 Module: $RCSfile: bbtkDynamicLibraryHandling.h,v $
7 Date: $Date: 2008/01/22 15:02:00 $
8 Version: $Revision: 1.1 $
11 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
12 l'Image). All rights reserved. See doc/license.txt or
13 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
15 This software is distributed WITHOUT ANY WARRANTY; without even
16 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17 PURPOSE. See the above copyright notices for more information.
19 =========================================================================*/
22 *\brief Dynamic library loading stuff (OS dependent)
25 // System dependent includes for loading dynamic libraries
29 // dlopen, dlsym, etc.
32 // dlopen loading mode :
33 // instant/delayed symbol resolution
35 # define BBTK_RTLD_TIME RTLD_LAZY
37 # define BBTK_RTLD_TIME RTLD_NOW
39 // local/global symbol loading
40 // one **MUST** use RTLD_GLOBAL in order to have
41 // the RTTI mechanism travel correctly across packages (typeid,dynamic_cast...)
42 // however this can cause problems (symbol clashes) ...
44 // http://gcc.gnu.org/faq.html#dso
45 // http://gcc.gnu.org/ml/gcc/2003-04/msg00256.html
46 // http://gcc.gnu.org/ml/gcc-bugs/2003-10/msg02771.html
47 #ifndef BBTK_RTLD_LOCAL
48 # define BBTK_RTLD_SCOPE RTLD_GLOBAL
50 # define BBTK_RTLD_SCOPE RTLD_LOCAL
56 typedef void* DynamicLibraryHandler;
61 // HINSTANCE, LoadLibrary, etc. definition
66 typedef HINSTANCE DynamicLibraryHandler;
71 ERROR !! DYNAMIC LIBRARY LOADING NOT IMPLEMENTED FOR YOUR SYSTEM