| 33 | } |
| 34 | |
| 35 | std::string GforcePro::get_lib_name () |
| 36 | { |
| 37 | std::string gforcelib_path = ""; |
| 38 | std::string gforcelib_name = ""; |
| 39 | char gforcelib_dir[1024]; |
| 40 | bool res = get_dll_path (gforcelib_dir); |
| 41 | if (sizeof (void *) == 4) |
| 42 | { |
| 43 | gforcelib_name = "gForceSDKWrapper32.dll"; |
| 44 | } |
| 45 | else |
| 46 | { |
| 47 | gforcelib_name = "gForceSDKWrapper.dll"; |
| 48 | } |
| 49 | |
| 50 | if (res) |
| 51 | { |
| 52 | gforcelib_path = std::string (gforcelib_dir) + gforcelib_name; |
| 53 | // gforcewrapper depends on gforcedll need to ensure that its in search path |
| 54 | if (const char *env_p = std::getenv ("PATH")) |
| 55 | { |
| 56 | std::string path_env ("PATH="); |
| 57 | path_env += env_p; |
| 58 | path_env += ";"; |
| 59 | path_env += std::string (gforcelib_dir); |
| 60 | if (_putenv (path_env.c_str ()) != 0) |
| 61 | { |
| 62 | safe_logger (spdlog::level::warn, "Failed to set PATH to {}", path_env.c_str ()); |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | gforcelib_path = gforcelib_name; |
| 69 | } |
| 70 | |
| 71 | safe_logger (spdlog::level::debug, "use dyn lib: {}", gforcelib_path.c_str ()); |
| 72 | return gforcelib_path; |
| 73 | } |
| 74 | |
| 75 | int GforcePro::prepare_session () |
| 76 | { |
nothing calls this directly
no test coverage detected