Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvapi: Use .def file for exporting #258

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ nvapi_dll = shared_library(target_name, [ nvapi_src, dxvk_nvapi_version ],
name_prefix : '',
dependencies : [ lib_dxgi, lib_d3d11, lib_version ],
include_directories : [ nvapi_headers, vk_headers ],
vs_module_defs : target_name+'.def',
install : true)

nvofapi_src = files([
Expand Down
3 changes: 3 additions & 0 deletions src/nvapi.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LIBRARY nvapi.dll
EXPORTS
nvapi_QueryInterface @2
3 changes: 3 additions & 0 deletions src/nvapi64.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LIBRARY nvapi64.dll
EXPORTS
nvapi_QueryInterface @2
2 changes: 1 addition & 1 deletion src/nvapi_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
log::info(str::format("NvAPI_QueryInterface: Ignoring unrecognized entrypoints from ", disabledEnvName, ": ", str::implode(", ", unrecognized)));
}

__declspec(dllexport) void* __cdecl nvapi_QueryInterface(NvU32 id) {
void* __cdecl nvapi_QueryInterface(NvU32 id) {
static std::unordered_map<NvU32, void*> registry;
static std::mutex registryMutex;
std::scoped_lock lock(registryMutex);
Expand Down