Skip to content

Commit

Permalink
ARROW-14405: [C++] Fix build error from clang for windows
Browse files Browse the repository at this point in the history
Closes #11495 from cyb70289/fix-clang-win

Authored-by: Yibo Cai <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
cyb70289 authored and lidavidm committed Oct 27, 2021
1 parent de11d49 commit 112fde5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ const std::shared_ptr<DataType>& IsoCalendarType() {
return type;
}

Result<std::locale> GetLocale(const std::string& locale) {
try {
return std::locale(locale.c_str());
} catch (const std::runtime_error& ex) {
return Status::Invalid("Cannot find locale '", locale, "': ", ex.what());
}
}

Status ValidateDayOfWeekOptions(const DayOfWeekOptions& options) {
if (options.week_start < 1 || 7 < options.week_start) {
return Status::Invalid(
Expand Down Expand Up @@ -465,6 +457,14 @@ struct Nanosecond {
// Convert timestamps to a string representation with an arbitrary format

#ifndef _WIN32
Result<std::locale> GetLocale(const std::string& locale) {
try {
return std::locale(locale.c_str());
} catch (const std::runtime_error& ex) {
return Status::Invalid("Cannot find locale '", locale, "': ", ex.what());
}
}

template <typename Duration, typename InType>
struct Strftime {
const StrftimeOptions& options;
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/io/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ class ReadableFile::ReadableFileImpl : public OSFile {
if (radvisory.ra_count > 0 && fcntl(fd_, F_RDADVISE, &radvisory) == -1) {
RETURN_NOT_OK(report_error(errno, "fcntl(fd, F_RDADVISE, ...) failed"));
}
#else
ARROW_UNUSED(report_error);
#endif
}
return Status::OK();
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/io/slow.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ARROW_EXPORT LatencyGenerator {
// XXX use ConcurrencyWrapper? It could increase chances of finding a race.

template <class StreamType>
class ARROW_EXPORT SlowInputStreamBase : public StreamType {
class SlowInputStreamBase : public StreamType {
public:
SlowInputStreamBase(std::shared_ptr<StreamType> stream,
std::shared_ptr<LatencyGenerator> latencies)
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ struct ARROW_EXPORT FixedSizeBinaryScalar : public BinaryScalar {
};

template <typename T>
struct ARROW_EXPORT TemporalScalar : internal::PrimitiveScalar<T> {
struct TemporalScalar : internal::PrimitiveScalar<T> {
using internal::PrimitiveScalar<T>::PrimitiveScalar;
using ValueType = typename TemporalScalar<T>::ValueType;

Expand All @@ -307,7 +307,7 @@ struct ARROW_EXPORT TemporalScalar : internal::PrimitiveScalar<T> {
};

template <typename T>
struct ARROW_EXPORT DateScalar : public TemporalScalar<T> {
struct DateScalar : public TemporalScalar<T> {
using TemporalScalar<T>::TemporalScalar;
using ValueType = typename TemporalScalar<T>::ValueType;

Expand Down Expand Up @@ -342,7 +342,7 @@ struct ARROW_EXPORT TimestampScalar : public TemporalScalar<TimestampType> {
};

template <typename T>
struct ARROW_EXPORT IntervalScalar : public TemporalScalar<T> {
struct IntervalScalar : public TemporalScalar<T> {
using TemporalScalar<T>::TemporalScalar;
using ValueType = typename TemporalScalar<T>::ValueType;

Expand Down

0 comments on commit 112fde5

Please sign in to comment.