Skip to content

Commit

Permalink
nvapi: Use .def file for exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
SveSop committed Feb 3, 2025
1 parent 6efef69 commit c3b8cdb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
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

0 comments on commit c3b8cdb

Please sign in to comment.