Skip to content

Commit 8b38903

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 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");
@@ -55,6 +58,7 @@ std::string ReadDsnString(const std::string& dsn, std::string_view key,
5558
SQLGetPrivateProfileString(wdsn.c_str(), wkey.c_str(), wdflt.c_str(), buf.data(),
5659
static_cast<int>(buf.size()), L"ODBC.INI");
5760
}
61+
#endif // defined(_WIN32)
5862

5963
std::wstring wresult = std::wstring(buf.data(), ret);
6064
CONVERT_UTF8_STR(const std::string result, wresult);
@@ -79,6 +83,8 @@ std::vector<std::string> ReadAllKeys(const std::string& dsn) {
7983

8084
std::vector<wchar_t> buf(BUFFER_SIZE);
8185

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

@@ -88,6 +94,7 @@ std::vector<std::string> ReadAllKeys(const std::string& dsn) {
8894
ret = SQLGetPrivateProfileString(wdsn.c_str(), NULL, L"", buf.data(),
8995
static_cast<int>(buf.size()), L"ODBC.INI");
9096
}
97+
#endif // defined(_WIN32)
9198

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

0 commit comments

Comments
 (0)