reformat code
This commit is contained in:
parent
2432c6fbdf
commit
720de00eb7
1 changed files with 58 additions and 67 deletions
|
@ -1,8 +1,5 @@
|
|||
#include "nvapi.h"
|
||||
|
||||
// TODO: remove
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <libloaderapi.h>
|
||||
#elif __linux__
|
||||
|
@ -52,13 +49,9 @@ void nvapi_init() {
|
|||
// lookup QueryInterface
|
||||
if (lib) {
|
||||
#ifdef _WIN32
|
||||
if (!nvapi_QueryInterface) {
|
||||
nvapi_QueryInterface = (nvapi_QueryInterface_t) GetProcAddress(lib, "nvapi_QueryInterface");
|
||||
}
|
||||
#elif __linux__
|
||||
if (!nvapi_QueryInterface) {
|
||||
nvapi_QueryInterface = (nvapi_QueryInterface_t) dlsym(lib, "nvapi_QueryInterface");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -83,15 +76,13 @@ void nvapi_free() {
|
|||
}
|
||||
|
||||
// free library
|
||||
if (lib) {
|
||||
#ifdef _WIN32
|
||||
if (lib) {
|
||||
FreeLibrary(lib);
|
||||
}
|
||||
#elif __linux__
|
||||
if (lib) {
|
||||
dlclose(lib);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// invalidate pointers
|
||||
lib = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue