[llvm-commits] [llvm] r137791 - in /llvm/trunk: include/llvm/Support/DynamicLibrary.h lib/Support/DynamicLibrary.cpp lib/Support/Windows/DynamicLibrary.inc
Francois Pichet
pichet2000 at gmail.com
Tue Aug 16 17:57:20 PDT 2011
hi,
2 compile errors on Windows:
On Tue, Aug 16, 2011 at 8:29 PM, Jordy Rose <jediknil at belkadan.com> wrote:
> Author: jrose
> Date: Tue Aug 16 19:29:32 2011
> New Revision: 137791
>
> extern "C" {
>
> @@ -63,30 +63,43 @@
> #endif
> stricmp(ModuleName, "msvcrt20") != 0 &&
> stricmp(ModuleName, "msvcrt40") != 0) {
> - OpenedHandles.push_back((HMODULE)ModuleBase);
> + OpenedHandles->push_back((HMODULE)ModuleBase);
A DenseSet doesn't have push_back, use insert.
> return TRUE;
> }
> }
>
> -bool DynamicLibrary::LoadLibraryPermanently(const char *filename,
> - std::string *ErrMsg) {
> - if (filename) {
> - HMODULE a_handle = LoadLibrary(filename);
> -
> - if (a_handle == 0)
> - return MakeErrMsg(ErrMsg, std::string(filename) + ": Can't open : ");
> -
> - OpenedHandles.push_back(a_handle);
> - } else {
> - // When no file is specified, enumerate all DLLs and EXEs in the
> - // process.
> +DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,
> + std::string *errMsg) {
> + if (!filename) {
> + // When no file is specified, enumerate all DLLs and EXEs in the process.
> + SmartScopedLock<true> lock(getMutex());
> + if (OpenedHandles == 0)
> + OpenedHandles = new DenseSet<HMODULE>();
> +
> EnumerateLoadedModules(GetCurrentProcess(), ELM_Callback, 0);
> + // Dummy library that represents "search all handles".
> + // This is mostly to ensure that the return value still shows up as "valid".
> + return DynamicLibrary(&OpenedHandles);
> + }
> +
> + HMODULE a_handle = LoadLibrary(filename);
> +
> + if (a_handle == 0) {
> + MakeErrMsg(ErrMsg, std::string(filename) + ": Can't open : ");
errMsg
More information about the llvm-commits
mailing list