Skip to content

Commit 190c145

Browse files
committed
fix: introduce missing ICEBERG_DATA_EXPORT
1 parent a056119 commit 190c145

13 files changed

Lines changed: 78 additions & 47 deletions

src/iceberg/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ add_iceberg_lib(iceberg_data
203203
SHARED_INSTALL_INTERFACE_LIBS
204204
${ICEBERG_DATA_SHARED_INSTALL_INTERFACE_LIBS})
205205

206-
if(TARGET iceberg_data_shared)
207-
target_compile_definitions(iceberg_data_shared PRIVATE ICEBERG_EXPORTING)
208-
endif()
209-
210206
if(TARGET iceberg_data_static)
211207
target_compile_definitions(iceberg_data_static PRIVATE ICEBERG_STATIC)
212208
endif()

src/iceberg/data/data_writer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
#include "iceberg/arrow_c_data.h"
3232
#include "iceberg/data/writer.h"
3333
#include "iceberg/file_format.h"
34-
#include "iceberg/iceberg_export.h"
34+
#include "iceberg/iceberg_data_export.h"
3535
#include "iceberg/result.h"
3636
#include "iceberg/row/partition_values.h"
3737
#include "iceberg/type_fwd.h"
3838

3939
namespace iceberg {
4040

4141
/// \brief Options for creating a DataWriter.
42-
struct ICEBERG_EXPORT DataWriterOptions {
42+
struct ICEBERG_DATA_EXPORT DataWriterOptions {
4343
std::string path;
4444
std::shared_ptr<Schema> schema;
4545
std::shared_ptr<PartitionSpec> spec;
@@ -51,7 +51,7 @@ struct ICEBERG_EXPORT DataWriterOptions {
5151
};
5252

5353
/// \brief Writer for Iceberg data files.
54-
class ICEBERG_EXPORT DataWriter : public FileWriter {
54+
class ICEBERG_DATA_EXPORT DataWriter : public FileWriter {
5555
public:
5656
~DataWriter() override;
5757

src/iceberg/data/delete_loader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
#include <span>
2727
#include <string_view>
2828

29-
#include "iceberg/iceberg_export.h"
29+
#include "iceberg/iceberg_data_export.h"
3030
#include "iceberg/result.h"
3131
#include "iceberg/type_fwd.h"
3232

3333
namespace iceberg {
3434

3535
/// \brief Loads delete files and constructs in-memory delete indexes.
36-
class ICEBERG_EXPORT DeleteLoader {
36+
class ICEBERG_DATA_EXPORT DeleteLoader {
3737
public:
3838
/// \brief Create a DeleteLoader.
3939
/// \param io FileIO instance for reading delete files

src/iceberg/data/equality_delete_writer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
#include "iceberg/arrow_c_data.h"
3333
#include "iceberg/data/writer.h"
3434
#include "iceberg/file_format.h"
35-
#include "iceberg/iceberg_export.h"
35+
#include "iceberg/iceberg_data_export.h"
3636
#include "iceberg/result.h"
3737
#include "iceberg/row/partition_values.h"
3838
#include "iceberg/type_fwd.h"
3939

4040
namespace iceberg {
4141

4242
/// \brief Options for creating an EqualityDeleteWriter.
43-
struct ICEBERG_EXPORT EqualityDeleteWriterOptions {
43+
struct ICEBERG_DATA_EXPORT EqualityDeleteWriterOptions {
4444
std::string path;
4545
std::shared_ptr<Schema> schema;
4646
std::shared_ptr<PartitionSpec> spec;
@@ -54,7 +54,7 @@ struct ICEBERG_EXPORT EqualityDeleteWriterOptions {
5454
};
5555

5656
/// \brief Writer for Iceberg equality delete files.
57-
class ICEBERG_EXPORT EqualityDeleteWriter : public FileWriter {
57+
class ICEBERG_DATA_EXPORT EqualityDeleteWriter : public FileWriter {
5858
public:
5959
~EqualityDeleteWriter() override;
6060

src/iceberg/data/position_delete_writer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
#include "iceberg/arrow_c_data.h"
3232
#include "iceberg/data/writer.h"
3333
#include "iceberg/file_format.h"
34-
#include "iceberg/iceberg_export.h"
34+
#include "iceberg/iceberg_data_export.h"
3535
#include "iceberg/result.h"
3636
#include "iceberg/row/partition_values.h"
3737
#include "iceberg/type_fwd.h"
3838

3939
namespace iceberg {
4040

4141
/// \brief Options for creating a PositionDeleteWriter.
42-
struct ICEBERG_EXPORT PositionDeleteWriterOptions {
42+
struct ICEBERG_DATA_EXPORT PositionDeleteWriterOptions {
4343
std::string path;
4444
std::shared_ptr<Schema> schema;
4545
std::shared_ptr<PartitionSpec> spec;
@@ -51,7 +51,7 @@ struct ICEBERG_EXPORT PositionDeleteWriterOptions {
5151
};
5252

5353
/// \brief Writer for Iceberg position delete files.
54-
class ICEBERG_EXPORT PositionDeleteWriter : public FileWriter {
54+
class ICEBERG_DATA_EXPORT PositionDeleteWriter : public FileWriter {
5555
public:
5656
~PositionDeleteWriter() override;
5757

src/iceberg/data/writer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
#include <vector>
2828

2929
#include "iceberg/arrow_c_data.h"
30-
#include "iceberg/iceberg_export.h"
30+
#include "iceberg/iceberg_data_export.h"
3131
#include "iceberg/result.h"
3232
#include "iceberg/type_fwd.h"
3333

3434
namespace iceberg {
3535

3636
/// \brief Base interface for data file writers.
37-
class ICEBERG_EXPORT FileWriter {
37+
class ICEBERG_DATA_EXPORT FileWriter {
3838
public:
3939
virtual ~FileWriter();
4040

@@ -49,7 +49,7 @@ class ICEBERG_EXPORT FileWriter {
4949
virtual Status Close() = 0;
5050

5151
/// \brief File metadata for all files produced by this writer.
52-
struct ICEBERG_EXPORT WriteResult {
52+
struct ICEBERG_DATA_EXPORT WriteResult {
5353
/// Usually a writer produces a single data or delete file.
5454
/// Position delete writer may produce multiple file-scoped delete files.
5555
/// In the future, multiple files can be produced if file rolling is supported.

src/iceberg/deletes/position_delete_index.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <memory>
2727

2828
#include "iceberg/deletes/roaring_position_bitmap.h"
29-
#include "iceberg/iceberg_export.h"
29+
#include "iceberg/iceberg_data_export.h"
3030

3131
namespace iceberg {
3232

@@ -35,7 +35,7 @@ namespace iceberg {
3535
/// This class provides a domain-specific API for position deletes
3636
/// in Iceberg MOR (merge-on-read) tables. Positions are 0-based
3737
/// row indices within a data file.
38-
class ICEBERG_EXPORT PositionDeleteIndex {
38+
class ICEBERG_DATA_EXPORT PositionDeleteIndex {
3939
public:
4040
PositionDeleteIndex() = default;
4141
~PositionDeleteIndex() = default;

src/iceberg/deletes/roaring_position_bitmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <string>
2929
#include <string_view>
3030

31-
#include "iceberg/iceberg_export.h"
31+
#include "iceberg/iceberg_data_export.h"
3232
#include "iceberg/result.h"
3333

3434
namespace iceberg {
@@ -45,7 +45,7 @@ namespace iceberg {
4545
/// \note This class is used to represent deletion vectors. The Puffin reader/writer
4646
/// handle adding the additional required framing (length prefix, magic bytes, CRC-32)
4747
/// for `deletion-vector-v1` persistence.
48-
class ICEBERG_EXPORT RoaringPositionBitmap {
48+
class ICEBERG_DATA_EXPORT RoaringPositionBitmap {
4949
public:
5050
/// \brief Maximum supported position (aligned with the Java implementation).
5151
static constexpr int64_t kMaxPosition = 0x7FFFFFFE80000000LL;

src/iceberg/iceberg_data_export.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#pragma once
21+
22+
#if defined(_WIN32) || defined(__CYGWIN__)
23+
# ifdef ICEBERG_DATA_STATIC
24+
# define ICEBERG_DATA_EXPORT
25+
# elif defined(ICEBERG_DATA_EXPORTING)
26+
# define ICEBERG_DATA_EXPORT __declspec(dllexport)
27+
# else
28+
# define ICEBERG_DATA_EXPORT __declspec(dllimport)
29+
# endif
30+
#else // Not Windows
31+
# ifndef ICEBERG_DATA_EXPORT
32+
# define ICEBERG_DATA_EXPORT __attribute__((visibility("default")))
33+
# endif
34+
#endif

src/iceberg/meson.build

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ iceberg_data_lib = library(
196196
include_directories: iceberg_include_dir,
197197
install: true,
198198
gnu_symbol_visibility: 'inlineshidden',
199-
cpp_shared_args: ['-DICEBERG_EXPORTING'],
200-
cpp_static_args: ['-DICEBERG_STATIC'],
199+
cpp_shared_args: ['-DICEBERG_DATA_EXPORTING'],
200+
cpp_static_args: ['-DICEBERG_DATA_STATIC'],
201201
)
202202

203203
iceberg_data_interface_args = []
204204
if get_option('default_library') != 'shared'
205-
iceberg_data_interface_args += ['-DICEBERG_STATIC']
205+
iceberg_data_interface_args += ['-DICEBERG_DATA_STATIC']
206206
endif
207207

208208
iceberg_data_dep = declare_dependency(
@@ -229,6 +229,7 @@ install_headers(
229229
'file_io_registry.h',
230230
'file_reader.h',
231231
'file_writer.h',
232+
'iceberg_data_export.h',
232233
'iceberg_export.h',
233234
'inheritable_metadata.h',
234235
'location_provider.h',

0 commit comments

Comments
 (0)