| 1265 | |
| 1266 | |
| 1267 | bool Foam::dlSymFound(void* handle, const std::string& symbol) |
| 1268 | { |
| 1269 | if (handle && !symbol.empty()) |
| 1270 | { |
| 1271 | if (POSIX::debug) |
| 1272 | { |
| 1273 | std::cout |
| 1274 | << "dlSymFound(void*, const std::string&)" |
| 1275 | << " : dlsym of " << symbol << std::endl; |
| 1276 | } |
| 1277 | |
| 1278 | // clear any old errors - see manpage dlopen |
| 1279 | (void) ::dlerror(); |
| 1280 | |
| 1281 | // get address of symbol |
| 1282 | (void) ::dlsym(handle, symbol.c_str()); |
| 1283 | |
| 1284 | // symbol can be found if there was no error |
| 1285 | return !::dlerror(); |
| 1286 | } |
| 1287 | else |
| 1288 | { |
| 1289 | return false; |
| 1290 | } |
| 1291 | } |
| 1292 | |
| 1293 | |
| 1294 | static int collectLibsCallback |
no test coverage detected