Fast RTPS  Version 2.14.5
Fast RTPS
fastrtps_dll.h
1 // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef _FASTRTPS_FASTRTPS_DLL_H_
16 #define _FASTRTPS_FASTRTPS_DLL_H_
17 
18 #include <fastrtps/config.h>
19 
20 // normalize macros
21 #if !defined(FASTRTPS_DYN_LINK) && !defined(FASTRTPS_STATIC_LINK) \
22  && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK)
23 #define FASTRTPS_STATIC_LINK
24 #endif // FASTRTPS_DYN_LINK && FASTRTPS_STATIC_LINK && EPROSIMA_ALL_DYN_LINK && EPROSIMA_ALL_STATIC_LINK
25 
26 #if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTRTPS_DYN_LINK)
27 #define FASTRTPS_DYN_LINK
28 #endif // EPROSIMA_ALL_DYN_LINK && FASTRTPS_DYN_LINK
29 
30 #if defined(FASTRTPS_DYN_LINK) && defined(FASTRTPS_STATIC_LINK)
31 #error Must not define both FASTRTPS_DYN_LINK and FASTRTPS_STATIC_LINK
32 #endif // FASTRTPS_DYN_LINK && FASTRTPS_STATIC_LINK
33 
34 #if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTRTPS_NO_LIB)
35 #define FASTRTPS_NO_LIB
36 #endif // EPROSIMA_ALL_NO_LIB && FASTRTPS_NO_LIB
37 
38 // enable dynamic linking
39 
40 #if defined(_WIN32)
41 #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK)
42 #if defined(MINGW_COMPILER)
43  #if defined(fastrtps_EXPORTS)
44  #define RTPS_DllAPI __declspec( dllexport )
45  #else
46  #define RTPS_DllAPI __attribute__((visibility("default")))
47  #endif // FASTRTPS_SOURCE
48 #else
49  #if defined(fastrtps_EXPORTS)
50  #define RTPS_DllAPI __declspec( dllexport )
51  #else
52  #define RTPS_DllAPI __declspec( dllimport )
53  #endif // FASTRTPS_SOURCE
54 #endif // MINGW_COMPILER
55 #else
56 #define RTPS_DllAPI
57 #endif // EPROSIMA_ALL_DYN_LINK || definedFASTRTPS_DYN_LINK
58 #else
59 #define RTPS_DllAPI
60 #endif // _WIN32
61 
62 // Auto linking.
63 
64 #if !defined(FASTRTPS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \
65  && !defined(FASTRTPS_NO_LIB)
66 
67 // Set properties.
68 #define EPROSIMA_LIB_NAME fastrtps
69 
70 #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK)
71 #define EPROSIMA_DYN_LINK
72 #endif // EPROSIMA_ALL_DYN_LINK || FASTRTPS_DYN_LINK
73 
74 #include <fastrtps/eProsima_auto_link.h>
75 #endif // auto-linking disabled
76 
77 #endif // _fastrtps_fastrtps_DLL_H_