| 54 | |
| 55 | template <typename T> |
| 56 | static T _getfunc(const char *lib, const char *fn) |
| 57 | { |
| 58 | static T proc = nullptr; |
| 59 | if (!proc) |
| 60 | { |
| 61 | auto mod = LoadLibraryA(lib); |
| 62 | if (mod) proc = reinterpret_cast<T>(GetProcAddress(mod, fn)); |
| 63 | } |
| 64 | return proc; |
| 65 | } |
| 66 | |
| 67 | #define getfunc(lib, fn) _getfunc<fn>(lib, #fn) |
| 68 |
nothing calls this directly
no outgoing calls
no test coverage detected