Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ltdl is used for dynamic loading of datasource plugins in Mapnik. But it can be hard to compile on windows and is unneeded on all other platforms. On Windows we can avoid it by calling Windows api's and on On OS X 10.8 apple stopped providing ltdl but dlopen/dlfcn.h is available and the recommended way: https://developer.apple.com/library/mac/#documentation/developertools/Reference/MachOReference/Reference/reference.html
I have also researched other toolkits and how they support dynamic loading in a cross platform way and tools like gdb, llvm, and node.js/libuv also take this approach of using windows apis directly and otherwise just dlopen.
One thing this patch does not do is leverage/report any errors from
dlopen
. Honestly I don't think this is critical. Ltdl provided an api to get errors but it was so buggy I ultimately disabled it. So, not accessing errors from dlopen/LoadLibrary does not regress any functionality at all. In the future we could consider adding this if it seems needed, but I think we should not mess with custom errors for now.