From 760052d60fa94b56af9d0025ee0cbc48a4475d76 Mon Sep 17 00:00:00 2001 From: Ian Cook Date: Mon, 3 May 2021 17:39:31 -0400 Subject: [PATCH 1/3] Undefine OPTIONAL in cpp/src/parquet/types.h --- cpp/src/parquet/types.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index f3d3abfc918..b000a7a6c37 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -17,6 +17,16 @@ #pragma once +#ifdef _WIN32 + +// parquet.thrift's OPTIONAL RepetitionType conflicts with a #define from +// above, so we undefine it +#ifdef OPTIONAL +#undef OPTIONAL +#endif + +#endif + #include #include #include From 1a772469313091122fe810f0c9c07177c47e7412 Mon Sep 17 00:00:00 2001 From: Ian Cook Date: Tue, 4 May 2021 08:57:45 -0400 Subject: [PATCH 2/3] Move code and improve comments --- cpp/src/parquet/types.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index b000a7a6c37..7ea2ca9ab4b 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -17,16 +17,6 @@ #pragma once -#ifdef _WIN32 - -// parquet.thrift's OPTIONAL RepetitionType conflicts with a #define from -// above, so we undefine it -#ifdef OPTIONAL -#undef OPTIONAL -#endif - -#endif - #include #include #include @@ -39,6 +29,16 @@ #include "parquet/platform.h" #include "parquet/type_fwd.h" +#ifdef _WIN32 + +// parquet.thrift's OPTIONAL RepetitionType conflicts with a #define, +// so we undefine it +#ifdef OPTIONAL +#undef OPTIONAL +#endif + +#endif // _WIN32 + namespace arrow { namespace util { From 87b3ceb07999a348efa54568b3dd261602fbfdd5 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 4 May 2021 17:01:42 +0200 Subject: [PATCH 3/3] Nit --- cpp/src/parquet/types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index 7ea2ca9ab4b..4529dbe6133 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -31,13 +31,12 @@ #ifdef _WIN32 -// parquet.thrift's OPTIONAL RepetitionType conflicts with a #define, -// so we undefine it +// Repetition::OPTIONAL conflicts with a #define, so we undefine it #ifdef OPTIONAL #undef OPTIONAL #endif -#endif // _WIN32 +#endif // _WIN32 namespace arrow { namespace util {