Ariles
visibility.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2019 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @brief Visibility defines, e.g., https://gcc.gnu.org/wiki/Visibility
9 */
10 
11 #pragma once
12 
13 #ifndef H_ARILES2_VISIBILITY
14 # define H_ARILES2_VISIBILITY
15 
16 # ifndef ARILES2_LOCAL
17 # if defined _WIN32 || defined __CYGWIN__
18 # define ARILES2_LIB_IMPORT __declspec(dllimport)
19 # define ARILES2_LIB_EXPORT __declspec(dllexport)
20 # define ARILES2_LIB_LOCAL
21 # else
22 # if __GNUC__ >= 4
23 # define ARILES2_LIB_IMPORT __attribute__((visibility("default")))
24 # define ARILES2_LIB_EXPORT __attribute__((visibility("default")))
25 # define ARILES2_LIB_LOCAL __attribute__((visibility("hidden")))
26 # else
27 # define ARILES2_LIB_IMPORT
28 # define ARILES2_LIB_EXPORT
29 # define ARILES2_LIB_LOCAL
30 # endif
31 # endif
32 
33 
34 # ifdef ARILES2_COMPILE_SHARED_LIB
35 // compiled as a shared library (the default)
36 # define ARILES2_LOCAL ARILES2_LIB_LOCAL
37 
38 # ifdef ARILES2_IMPORT_LIB
39 // this apparently makes sense only in WIN
40 # define ARILES2_API ARILES2_LIB_IMPORT
41 # else
42 # define ARILES2_API ARILES2_LIB_EXPORT
43 # endif
44 # else
45 // compiled as a static library
46 # define ARILES2_API
47 # define ARILES2_LOCAL
48 # endif
49 # endif
50 #endif