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