ianmcook commented on code in PR #3320:
URL: https://github.com/apache/arrow-adbc/pull/3320#discussion_r2304221213


##########
c/driver_manager/adbc_driver_manager.cc:
##########
@@ -273,14 +273,39 @@ AdbcStatusCode LoadDriverManifest(const 
std::filesystem::path& driver_manifest,
   return ADBC_STATUS_OK;
 }
 
+std::vector<std::filesystem::path> GetEnvPaths(const char_type* env_var) {
+#ifdef _WIN32
+  size_t required_size;
+
+  _wgetenv_s(&required_size, NULL, 0, env_var);
+  if (required_size == 0) {
+    return {};
+  }
+
+  std::wstring path_var;
+  path_var.resize(required_size);
+  _wgetenv_s(&required_size, path_var.data(), required_size, env_var);
+  auto path = Utf8Encode(path_var);
+#else
+  const char* path_var = std::getenv(env_var);
+  if (!path_var) {
+    return {};
+  }
+  std::string path(path_var);
+#endif
+  return InternalAdbcParsePath(path);
+}
+
 std::vector<std::filesystem::path> GetSearchPaths(const AdbcLoadFlags levels) {
   std::vector<std::filesystem::path> paths;
   if (levels & ADBC_LOAD_FLAG_SEARCH_ENV) {
+#ifdef _WIN32
+    static const wchar_t* env_var = L"ADBC_CONFIG_PATH";
+#else
+    static const char* env_var = "ADBC_CONFIG_PATH";
+#endif

Review Comment:
   ```suggestion
   #endif  // _WIN32
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to