iceberg-cpp
Loading...
Searching...
No Matches
iceberg_export.h
Go to the documentation of this file.
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
24
25#if defined(_WIN32) || defined(__CYGWIN__)
26# ifdef ICEBERG_STATIC
27# define ICEBERG_EXPORT
28# elif defined(ICEBERG_EXPORTING)
29# define ICEBERG_EXPORT __declspec(dllexport)
30# else
31# define ICEBERG_EXPORT __declspec(dllimport)
32# endif
33
34# define ICEBERG_TEMPLATE_EXPORT ICEBERG_EXPORT
35
36// For template class declarations. Empty on MSVC: dllexport on a class template
37// declaration combined with extern template triggers C4910.
38# if defined(_MSC_VER)
39# define ICEBERG_TEMPLATE_CLASS_EXPORT
40# else
41# define ICEBERG_TEMPLATE_CLASS_EXPORT ICEBERG_EXPORT
42# endif
43
44// For extern template declarations. Empty when building the DLL on MSVC:
45// `extern` + `dllexport` is contradictory and triggers C4910.
46# if defined(_MSC_VER) && defined(ICEBERG_EXPORTING) && !defined(ICEBERG_STATIC)
47# define ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT
48# else
49# define ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT ICEBERG_TEMPLATE_EXPORT
50# endif
51
52#else // Non-Windows
53# ifndef ICEBERG_EXPORT
54# define ICEBERG_EXPORT __attribute__((visibility("default")))
55# endif
56
57# define ICEBERG_TEMPLATE_EXPORT
58# define ICEBERG_TEMPLATE_CLASS_EXPORT ICEBERG_EXPORT
59# define ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT ICEBERG_TEMPLATE_CLASS_EXPORT
60#endif