Main MRPT website > C++ reference
MRPT logo
graphslam/include/mrpt/graphslam/link_pragmas.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://mrpt.sourceforge.net/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 
29 #ifndef GRAPHSLAM_link_pragmas_H
30 #define GRAPHSLAM_link_pragmas_H
31 
32 #include <mrpt/config.h>
33 #include <mrpt/utils/boost_join.h>
34 
35 // ** Important! **
36 // In each mrpt library, search and replace:
37 // MRPT_XXX_EXPORT, MRPT_XXX_IMPORT
38 // GRAPHSLAM_IMPEXP, mrpt_xxx_EXPORTS
39 
40 // If we are building the DLL (_EXPORTS), do not link against the .lib files:
41 #if !defined(mrpt_graphslam_EXPORTS) && (defined(_MSC_VER) || defined(__BORLANDC__))
42 # if defined(_DEBUG)
43 # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-graphslam",MRPT_VERSION_POSTFIX),"-dbg.lib"))
44 # else
45 # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-graphslam",MRPT_VERSION_POSTFIX),".lib"))
46 # endif
47 #endif
48 
49 
50 
51 
52 /* The macros below for DLL import/export are required for Windows only.
53  Mostly all the definitions in this file are copied or at least topod
54  on the file wx/dlimpexp.h, written by Vadim Zeitlin and published
55  under the wxWindows licence.
56 */
57 #if defined(MRPT_OS_WINDOWS)
58  /*
59  __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
60  as VC++ and gcc
61  */
62 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
63 # define MRPT_GRAPHSLAM_EXPORT __declspec(dllexport)
64 # define MRPT_GRAPHSLAM_IMPORT __declspec(dllimport)
65 # else /* compiler doesn't support __declspec() */
66 # define MRPT_GRAPHSLAM_EXPORT
67 # define MRPT_GRAPHSLAM_IMPORT
68 # endif
69 #elif defined(MRPT_OS_OS2) /* was __WXPM__ */
70 # if defined (__WATCOMC__)
71 # define MRPT_GRAPHSLAM_EXPORT __declspec(dllexport)
72  /*
73  __declspec(dllimport) prepends __imp to imported symbols. We do NOT
74  want that!
75  */
76 # define MRPT_GRAPHSLAM_IMPORT
77 # elif defined(__EMX__)
78 # define MRPT_GRAPHSLAM_EXPORT
79 # define MRPT_GRAPHSLAM_IMPORT
80 # elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
81 # define MRPT_GRAPHSLAM_EXPORT _Export
82 # define MRPT_GRAPHSLAM_IMPORT _Export
83 # endif
84 #elif defined(MRPT_OS_APPLE)
85 # ifdef __MWERKS__
86 # define MRPT_GRAPHSLAM_EXPORT __declspec(export)
87 # define MRPT_GRAPHSLAM_IMPORT __declspec(import)
88 # endif
89 #elif defined(__CYGWIN__)
90 # define MRPT_GRAPHSLAM_EXPORT __declspec(dllexport)
91 # define MRPT_GRAPHSLAM_IMPORT __declspec(dllimport)
92 #endif
93 
94 /* for other platforms/compilers we don't anything */
95 #ifndef MRPT_GRAPHSLAM_EXPORT
96 # define MRPT_GRAPHSLAM_EXPORT
97 # define MRPT_GRAPHSLAM_IMPORT
98 #endif
99 
100 /* Macros that map to export declaration when building the DLL, to import
101  declaration if using it or to nothing at all if we are not compiling as DLL */
102 #if defined(MRPT_BUILT_AS_DLL)
103 # if defined(mrpt_graphslam_EXPORTS) /* Building the DLL */
104 # define GRAPHSLAM_IMPEXP MRPT_GRAPHSLAM_EXPORT
105 # else /* Using the DLL */
106 # define GRAPHSLAM_IMPEXP MRPT_GRAPHSLAM_IMPORT
107 # endif
108 #else /* not making nor using DLL */
109 # define GRAPHSLAM_IMPEXP
110 #endif
111 
112 
113 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013