Skip to content

Commit

Permalink
Fix GCC build error with std::to_char<double> (#11369)
Browse files Browse the repository at this point in the history
Summary:
#11103 breaks GCC build
```
In instantiation of function template specialization 'facebook::velox::functions::(anonymous namespace)::padContent<double>' call to 'to_chars' is ambiguous
```

To minimize code changes, this PR add unsigned cast for ceil to fix it.

Pull Request resolved: #11369

Reviewed By: Yuhta

Differential Revision: D65420211

Pulled By: mbasmanova

fbshipit-source-id: 18aba3a62012a86d1bc3e7fec57dda54c992050e
  • Loading branch information
Yohahaha authored and facebook-github-bot committed Nov 5, 2024
1 parent 30fc13e commit f9b24d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions velox/functions/lib/DateTimeFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,10 @@ int32_t DateTimeFormatter::format(
}
case DateTimeFormatSpecifier::WEEK_OF_MONTH: {
result += padContent(
ceil(
unsigned(ceil(
(7 + static_cast<unsigned>(calDate.day()) -
weekday.c_encoding() - 1) /
7.0),
7.0)),
'0',
token.pattern.minRepresentDigits,
maxResultEnd,
Expand Down

0 comments on commit f9b24d5

Please sign in to comment.