Skip to content

Commit 004b470

Browse files
committed
Address David's comments
1 parent 89d72ee commit 004b470

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

cpp/src/arrow/flight/sql/odbc/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ else()
3333
set(ODBCINST odbcinst)
3434
endif()
3535

36-
add_definitions(-DUNICODE=1)
37-
3836
add_subdirectory(odbc_impl)
3937

4038
arrow_install_all_headers("arrow/flight/sql/odbc")
@@ -57,7 +55,7 @@ add_arrow_lib(arrow_flight_sql_odbc
5755
DEPENDENCIES
5856
arrow_flight_sql
5957
DEFINITIONS
60-
FMT_HEADER_ONLY
58+
UNICODE
6159
SHARED_LINK_FLAGS
6260
${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt
6361
SHARED_LINK_LIBS

cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ add_library(arrow_odbc_spi_impl
110110
type_utilities.h
111111
util.cc
112112
util.h)
113+
target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE)
113114
target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl)
114115
target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR})
115116

cpp/src/arrow/flight/sql/odbc/odbc_impl/system_trust_store.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ bool SystemTrustStore::HasNext() {
3131

3232
std::string SystemTrustStore::GetNext() const {
3333
DWORD size = 0;
34-
CryptBinaryToString(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
35-
CRYPT_STRING_BASE64HEADER, nullptr, &size);
36-
37-
std::wstring wcert;
38-
wcert.resize(size);
39-
CryptBinaryToString(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
40-
CRYPT_STRING_BASE64HEADER, &wcert[0], &size);
41-
wcert.resize(size);
42-
43-
std::string cert = arrow::util::WideStringToUTF8(wcert).ValueOr("");
34+
CryptBinaryToStringA(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
35+
CRYPT_STRING_BASE64HEADER, nullptr, &size);
36+
37+
std::string cert;
38+
cert.resize(size);
39+
CryptBinaryToStringA(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
40+
CRYPT_STRING_BASE64HEADER, &cert[0], &size);
41+
cert.resize(size);
4442

4543
return cert;
4644
}

0 commit comments

Comments
 (0)