Skip to content

Commit

Permalink
ARROW-8000: [C++] Fix compilation on gcc 4.8
Browse files Browse the repository at this point in the history
It seems that `constexpr auto` with function pointers is not supported in gcc 4.8.

Closes #6538 from wesm/ARROW-8000-gcc48-fixes and squashes the following commits:

ca01694 <Wes McKinney> Fix compilation on gcc 4.8

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
wesm authored and kou committed Mar 5, 2020
1 parent 71edd30 commit 8eddf3c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cpp/src/arrow/c/bridge_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,28 @@ using internal::SchemaExportTraits;
template <typename T>
struct ExportTraits {};

template <typename T>
using Exporter = std::function<Status(const T&, struct ArrowSchema*)>;

template <>
struct ExportTraits<DataType> {
static constexpr auto ExportFunc = ExportType;
static Exporter<DataType> ExportFunc;
};

template <>
struct ExportTraits<Field> {
static constexpr auto ExportFunc = ExportField;
static Exporter<Field> ExportFunc;
};

template <>
struct ExportTraits<Schema> {
static constexpr auto ExportFunc = ExportSchema;
static Exporter<Schema> ExportFunc;
};

Exporter<DataType> ExportTraits<DataType>::ExportFunc = ExportType;
Exporter<Field> ExportTraits<Field>::ExportFunc = ExportField;
Exporter<Schema> ExportTraits<Schema>::ExportFunc = ExportSchema;

// An interceptor that checks whether a release callback was called.
// (for import tests)
template <typename Traits>
Expand Down

0 comments on commit 8eddf3c

Please sign in to comment.