Main MRPT website
>
C++ reference for MRPT 1.4.0
mrpt
base
base/include/mrpt/base/link_pragmas.h
Go to the documentation of this file.
1
/* +---------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| http://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6
| See: http://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See details in http://www.mrpt.org/License |
8
+---------------------------------------------------------------------------+ */
9
10
#ifndef base_link_pragmas_H
11
#define base_link_pragmas_H
12
13
#include <mrpt/config.h>
14
#include <
mrpt/utils/boost_join.h
>
15
16
// ** Important! **
17
// In each mrpt library, search and replace:
18
// MRPT_XXX_EXPORT, MRPT_XXX_IMPORT
19
// BASE_IMPEXP, mrpt_xxx_EXPORTS
20
21
// If we are building the DLL (_EXPORTS), do not link against the .lib files:
22
#if !defined(mrpt_base_EXPORTS) && (defined(_MSC_VER) || defined(__BORLANDC__))
23
# if defined(_DEBUG)
24
# pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-base"
,MRPT_VERSION_POSTFIX),"-dbg.lib"))
25
# else
26
# pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-base"
,MRPT_VERSION_POSTFIX),".lib"))
27
# endif
28
#endif
29
30
31
32
33
/* The macros below for DLL import/export are required for Windows only.
34
Mostly all the definitions in this file are copied or at least based
35
on the file wx/dlimpexp.h, written by Vadim Zeitlin and published
36
under the wxWindows licence.
37
*/
38
#if defined(MRPT_OS_WINDOWS)
39
/*
40
__declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
41
as VC++ and gcc
42
*/
43
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
44
# define MRPT_BASE_EXPORT __declspec(dllexport)
45
# define MRPT_BASE_IMPORT __declspec(dllimport)
46
# else
/* compiler doesn't support __declspec() */
47
# define MRPT_BASE_EXPORT
48
# define MRPT_BASE_IMPORT
49
# endif
50
#elif defined(MRPT_OS_OS2)
/* was __WXPM__ */
51
# if defined (__WATCOMC__)
52
# define MRPT_BASE_EXPORT __declspec(dllexport)
53
/*
54
__declspec(dllimport) prepends __imp to imported symbols. We do NOT
55
want that!
56
*/
57
# define MRPT_BASE_IMPORT
58
# elif defined(__EMX__)
59
# define MRPT_BASE_EXPORT
60
# define MRPT_BASE_IMPORT
61
# elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
62
# define MRPT_BASE_EXPORT _Export
63
# define MRPT_BASE_IMPORT _Export
64
# endif
65
#elif defined(MRPT_OS_APPLE)
66
# ifdef __MWERKS__
67
# define MRPT_BASE_EXPORT __declspec(export)
68
# define MRPT_BASE_IMPORT __declspec(import)
69
# endif
70
#elif defined(__CYGWIN__)
71
# define MRPT_BASE_EXPORT __declspec(dllexport)
72
# define MRPT_BASE_IMPORT __declspec(dllimport)
73
#endif
74
75
/* for other platforms/compilers we don't anything */
76
#ifndef MRPT_BASE_EXPORT
77
# define MRPT_BASE_EXPORT
78
# define MRPT_BASE_IMPORT
79
#endif
80
81
/* Macros that map to export declaration when building the DLL, to import
82
declaration if using it or to nothing at all if we are not compiling as DLL */
83
#if defined(MRPT_BUILT_AS_DLL)
84
# if defined(mrpt_base_EXPORTS)
/* Building the DLL */
85
# define BASE_IMPEXP MRPT_BASE_EXPORT
86
# else
/* Using the DLL */
87
# define BASE_IMPEXP MRPT_BASE_IMPORT
88
# endif
89
#else
/* not making nor using DLL */
90
# define BASE_IMPEXP
91
#endif
92
93
// Finally this one allows exporting a class that inherits from a
94
// template in MS DLLs with both MSVC and GCC. To see how nasty is
95
// this, Google "class derived from template DLL export" and suffer...
96
#if defined(_MSC_VER)
97
# define BASE_IMPEXP_TEMPL
98
#else
99
// Mostly for Mingw:
100
# define BASE_IMPEXP_TEMPL BASE_IMPEXP
101
#endif
102
103
104
#endif
boost_join.h
Page generated by
Doxygen 1.9.5
for MRPT 1.4.0 SVN: at Mon Dec 26 04:51:47 UTC 2022