Skip to content

Commit 2a4db73

Browse files
committed
Remove DISALLOW_COPY_AND_ASSIGN from some abstract classes. Revert MANUALLY_ALIGNED_STRUCT
Change-Id: Iee3234b51ec20081ee8e4cfdcac7653ec28f8b2a
1 parent 39f10d6 commit 2a4db73

6 files changed

Lines changed: 29 additions & 14 deletions

File tree

cpp/src/arrow/array.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ class ARROW_EXPORT Array {
254254
}
255255
data_ = data;
256256
}
257-
258-
private:
259-
ARROW_DISALLOW_COPY_AND_ASSIGN(Array);
260257
};
261258

262259
static inline std::ostream& operator<<(std::ostream& os, const Array& x) {

cpp/src/arrow/builder.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ class ARROW_EXPORT ArrayBuilder {
154154
void UnsafeAppendToBitmap(const uint8_t* valid_bytes, int64_t length);
155155
// Set the next length bits to not null (i.e. valid).
156156
void UnsafeSetNotNull(int64_t length);
157-
158-
private:
159-
ARROW_DISALLOW_COPY_AND_ASSIGN(ArrayBuilder);
160157
};
161158

162159
class ARROW_EXPORT NullBuilder : public ArrayBuilder {

cpp/src/arrow/io/interfaces.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class ARROW_EXPORT FileInterface {
7979
FileInterface() {}
8080
FileMode::type mode_;
8181
void set_mode(FileMode::type mode) { mode_ = mode; }
82-
83-
private:
84-
ARROW_DISALLOW_COPY_AND_ASSIGN(FileInterface);
8582
};
8683

8784
class ARROW_EXPORT Seekable {

cpp/src/arrow/type.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ class ARROW_EXPORT DataType {
157157
protected:
158158
Type::type id_;
159159
std::vector<std::shared_ptr<Field>> children_;
160-
161-
private:
162-
ARROW_DISALLOW_COPY_AND_ASSIGN(DataType);
163160
};
164161

165162
// TODO(wesm): Remove this from parquet-cpp

cpp/src/arrow/util/compiler-util.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
// Deprecated header, here for backwards compatibility in parquet-cpp
19+
20+
#ifndef ARROW_UTIL_COMPILER_UTIL_H
21+
#define ARROW_UTIL_COMPILER_UTIL_H
22+
23+
#include "arrow/util/macros.h"
24+
25+
#endif // ARROW_UTIL_COMPILER_UTIL_H

cpp/src/arrow/util/macros.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,22 @@
6161
// macros to disable padding
6262
// these macros are portable across different compilers and platforms
6363
//[https://github.com/google/flatbuffers/blob/master/include/flatbuffers/flatbuffers.h#L1355]
64+
#if !defined(MANUALLY_ALIGNED_STRUCT)
6465
#if defined(_MSC_VER)
65-
#define ARROW_MANUALLY_ALIGNED_STRUCT(alignment) \
66+
#define MANUALLY_ALIGNED_STRUCT(alignment) \
6667
__pragma(pack(1)); \
6768
struct __declspec(align(alignment))
6869
#define STRUCT_END(name, size) \
6970
__pragma(pack()); \
7071
static_assert(sizeof(name) == size, "compiler breaks packing rules")
7172
#elif defined(__GNUC__) || defined(__clang__)
72-
#define ARROW_MANUALLY_ALIGNED_STRUCT(alignment) \
73+
#define MANUALLY_ALIGNED_STRUCT(alignment) \
7374
_Pragma("pack(1)") struct __attribute__((aligned(alignment)))
7475
#define STRUCT_END(name, size) \
7576
_Pragma("pack()") static_assert(sizeof(name) == size, "compiler breaks packing rules")
7677
#else
7778
#error Unknown compiler, please define structure alignment macros
7879
#endif
80+
#endif // !defined(MANUALLY_ALIGNED_STRUCT)
7981

8082
#endif // ARROW_UTIL_MACROS_H

0 commit comments

Comments
 (0)