Skip to content

Commit

Permalink
[Compile](fix) Fix mac complie BE error because codecvt_utf8_utf16 de…
Browse files Browse the repository at this point in the history
…precated in C++17 and atomic_long not support in mac
  • Loading branch information
HappenLee committed Oct 8, 2024
1 parent 8e3db00 commit f95de91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion be/src/vec/exec/scan/scanner_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class ScannerContext : public std::enable_shared_from_this<ScannerContext>,

// for scaling up the running scanners
size_t _estimated_block_size = 0;
std::atomic_long _block_memory_usage = 0;
std::atomic<int64_t> _block_memory_usage = 0;
int64_t _last_scale_up_time = 0;
int64_t _last_fetch_time = 0;
int64_t _total_wait_block_time = 0;
Expand Down
5 changes: 2 additions & 3 deletions be/src/vec/functions/function_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <algorithm>
#include <array>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/locale.hpp>
#include <climits>
#include <cmath>
#include <codecvt>
#include <cstddef>
#include <cstdlib>
#include <cstring>
Expand Down Expand Up @@ -448,8 +448,7 @@ class FunctionAutoPartitionName : public IFunction {

private:
std::u16string _string_to_u16string(const std::string& str) const {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
return convert.from_bytes(str);
return boost::locale::conv::utf_to_utf<char16_t>(str);
}

std::string _string_to_unicode(const std::u16string& s) const {
Expand Down

0 comments on commit f95de91

Please sign in to comment.