qpmad
Eigen-based C++ QP solver.
cpput_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_QPMAD_UTILS_VISIBILITY
14 # define H_QPMAD_UTILS_VISIBILITY
15 
16 # if defined _WIN32 || defined __CYGWIN__
17 # define QPMAD_UTILS_LIB_IMPORT __declspec(dllimport)
18 # define QPMAD_UTILS_LIB_EXPORT __declspec(dllexport)
19 # define QPMAD_UTILS_LIB_LOCAL
20 # else
21 # if __GNUC__ >= 4
22 # define QPMAD_UTILS_LIB_IMPORT __attribute__((visibility("default")))
23 # define QPMAD_UTILS_LIB_EXPORT __attribute__((visibility("default")))
24 # define QPMAD_UTILS_LIB_LOCAL __attribute__((visibility("hidden")))
25 # else
26 # define QPMAD_UTILS_LIB_IMPORT
27 # define QPMAD_UTILS_LIB_EXPORT
28 # define QPMAD_UTILS_LIB_LOCAL
29 # endif
30 # endif
31 
32 
33 # ifdef QPMAD_UTILS_COMPILE_SHARED_LIB
34 // compiled as a shared library (the default)
35 # define QPMAD_UTILS_LOCAL QPMAD_UTILS_LIB_LOCAL
36 
37 # ifdef QPMAD_UTILS_IMPORT_LIB
38 // this apparently makes sense only in WIN
39 # define QPMAD_UTILS_API QPMAD_UTILS_LIB_IMPORT
40 # else
41 # define QPMAD_UTILS_API QPMAD_UTILS_LIB_EXPORT
42 # endif
43 # else
44 // compiled as a static library
45 # define QPMAD_UTILS_API
46 # define QPMAD_UTILS_LOCAL
47 # endif
48 
49 #endif