Skip to content

Commit da2e4f5

Browse files
committed
Attempt to enable macOS CI build
1 parent 498c699 commit da2e4f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_impl/config/configuration.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ std::string ReadDsnString(const std::string& dsn, std::string_view key,
4444

4545
#define BUFFER_SIZE (1024)
4646
std::vector<wchar_t> buf(BUFFER_SIZE);
47+
48+
// TODO enable unicode support on macOS and Linux and remove the ifdef
49+
#if defined _WIN32
4750
int ret =
4851
SQLGetPrivateProfileString(wdsn.c_str(), wkey.c_str(), wdflt.c_str(), buf.data(),
4952
static_cast<int>(buf.size()), L"ODBC.INI");
@@ -59,6 +62,8 @@ std::string ReadDsnString(const std::string& dsn, std::string_view key,
5962
std::wstring wresult = std::wstring(buf.data(), ret);
6063
CONVERT_UTF8_STR(const std::string result, wresult);
6164
return result;
65+
#endif // defined(_WIN32)
66+
return std::string("");
6267
}
6368

6469
void RemoveAllKnownKeys(std::vector<std::string>& keys) {
@@ -79,6 +84,8 @@ std::vector<std::string> ReadAllKeys(const std::string& dsn) {
7984

8085
std::vector<wchar_t> buf(BUFFER_SIZE);
8186

87+
// TODO enable unicode support on macOS and Linux and remove the ifdef
88+
#if defined _WIN32
8289
int ret = SQLGetPrivateProfileString(wdsn.c_str(), NULL, L"", buf.data(),
8390
static_cast<int>(buf.size()), L"ODBC.INI");
8491

@@ -88,6 +95,7 @@ std::vector<std::string> ReadAllKeys(const std::string& dsn) {
8895
ret = SQLGetPrivateProfileString(wdsn.c_str(), NULL, L"", buf.data(),
8996
static_cast<int>(buf.size()), L"ODBC.INI");
9097
}
98+
#endif // defined(_WIN32)
9199

92100
// When you pass NULL to SQLGetPrivateProfileString it gives back a \0 delimited list of
93101
// all the keys. The below loop simply tokenizes all the keys and places them into a

0 commit comments

Comments
 (0)