Fast RTPS  Version 2.7.1
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
25 
26 #if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTRTPS_DYN_LINK)
27 #define FASTRTPS_DYN_LINK
28 #endif
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
33 
34 #if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTRTPS_NO_LIB)
35 #define FASTRTPS_NO_LIB
36 #endif
37 
38 // enable dynamic linking
39 
40 #if defined(_WIN32)
41 #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK)
42 #if defined(fastrtps_EXPORTS)
43 #define RTPS_DllAPI __declspec( dllexport )
44 #else
45 #define RTPS_DllAPI __declspec( dllimport )
46 #endif // FASTRTPS_SOURCE
47 #else
48 #define RTPS_DllAPI
49 #endif
50 #else
51 #define RTPS_DllAPI
52 #endif // _WIN32
53 
54 // Auto linking.
55 
56 #if !defined(FASTRTPS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \
57  && !defined(FASTRTPS_NO_LIB)
58 
59 // Set properties.
60 #define EPROSIMA_LIB_NAME fastrtps
61 
62 #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK)
63 #define EPROSIMA_DYN_LINK
64 #endif
65 
66 #include <fastrtps/eProsima_auto_link.h>
67 #endif // auto-linking disabled
68 
69 #endif // _fastrtps_fastrtps_DLL_H_