make dlopen snippet work on macos