Changeset b22a1e2 in tol
- Timestamp:
- Dec 22, 2015, 12:36:23 PM (11 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 89cc521
- Parents:
- d5e4e94
- Location:
- tol
- Files:
-
- 3 edited
-
CMakeLists.txt (modified) (1 diff)
-
LoadDynLib/LoadDynLib.cpp (modified) (2 diffs)
-
tol_version_def.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/CMakeLists.txt
rd5e4e94 rb22a1e2 238 238 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) 239 239 add_definitions( -DUNIX ) 240 #set( CMAKE_SHARED_LINKER_FLAGS "-rdynamic ${CMAKE_SHARED_LINKER_FLAGS}" ) 240 241 endif( ) 241 242 -
tol/LoadDynLib/LoadDynLib.cpp
rd5e4e94 rb22a1e2 34 34 #include <tol/tol_btxtgra.h> 35 35 #include <tol/tol_bdatgra.h> 36 #include <tol/tol_bsetgra.h> 36 37 #include <tol/tol_bdir.h> 37 38 … … 123 124 } 124 125 } 126 127 //-------------------------------------------------------------------- 128 DeclareContensClass(BDat, BDatTemporary, BDatDynLoad); 129 DefExtOpr(1, BDatDynLoad, "DynLoad", 1, 2, "Text Set", 130 "(Text libraryPath [, Set options])", 131 I2("Load a dynamic library without TOL built-in functions.", 132 "Carga una librería dinámica sin funciones TOL nativas."), 133 BOperClassify::Statistic_); 134 void BDatDynLoad::CalcContens() 135 //-------------------------------------------------------------------- 136 { 137 if(CheckNonDeclarativeAction("LoadDynLib")) { return; } 138 BText& libraryPath = Text(Arg(1)); 139 lt_dladvise advise; 140 if( Arg( 2 ) ) 141 { 142 BSet& options = Set( Arg( 2 ) ); 143 bool hasAdvise = false; 144 bool global = false; 145 BSyntaxObject *obj = options["global"]; 146 if ( obj && obj->Grammar() == GraReal( ) ) 147 { 148 BDat &dGlobal = Dat( obj ); 149 global = dGlobal.Value() != 0; 150 hasAdvise = true; 151 } 152 else 153 { 154 Warning( "DynLoad: global option provided but with wrong type, must be Real" ); 155 } 156 if ( hasAdvise ) 157 { 158 if ( !lt_dladvise_init( &advise ) ) 159 { 160 if ( global ) 161 { 162 lt_dladvise_global( &advise ); 163 } 164 } 165 else 166 { 167 advise = NULL; 168 Warning( "DynLoad: not using advise, lt_dladvise_init failed" ); 169 } 170 } 171 else 172 { 173 advise = NULL; 174 } 175 } 176 else 177 { 178 advise = NULL; 179 } 180 //Std(BText("\nTRACE BLoadDynLib::Evaluator 1 libraryPath=")+libraryPath); 181 //Std(BText("\nTRACE BLoadDynLib::Evaluator 2 libraryName=")+libraryName); 182 BUserNameBlock* unb ATTR_UNUSED = NULL; 183 184 // se cambia el directorio de trabajo (cwd) inicial 185 BText currentDir = BDir::GetCurrent(); 186 BDir::ChangeCurrent(GetFilePath(libraryPath)); 187 188 lt_dlhandle handleLib; 189 190 // abro la DynLib 191 handleLib = lt_dlopenadvise( libraryPath, advise ); 192 193 // se retorna al directorio de trabajo (cwd) inicial 194 BDir::ChangeCurrent(currentDir); 195 196 if ( !handleLib ) 197 { 198 //Std(BText("\nTRACE BLoadDynLib::Evaluator 3 lt_dlerror='")+lt_dlerror()+"'"); 199 BText reason( lt_dlerror( ) ); 200 Error(BText("[LoadDynLib(\"")+libraryPath+"\")]"+" \n" 201 " lt_dlopen error:'"+reason+"'"); 202 contens_ = false; 203 } 204 else 205 { 206 contens_ = true; 207 } 208 if ( advise ) 209 { 210 lt_dladvise_destroy( &advise ); 211 } 212 } 213 125 214 126 215 //-------------------------------------------------------------------- -
tol/tol_version_def.h
rd5e4e94 rb22a1e2 23 23 //////////////////////////////////////////////////////////////////////////////////// 24 24 #define VERSION_MAJOR 3 25 #define VERSION_MINOR 226 #define VERSION_BUILD "b0 21"25 #define VERSION_MINOR 5 26 #define VERSION_BUILD "b000" 27 27 28 28 #if defined(_MSC_VER)
Note: See TracChangeset
for help on using the changeset viewer.
