Main MRPT website > C++ reference
MRPT logo
hwdrivers_impexp.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
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 /* This file should be included from utils_defs.h only!
30 */
31 #ifndef _IAMINUTILSDEFS_H
32 #error Do not include this file manually
33 #endif
34 
35 /* This file defines macros for DLL import/export, required for
36  Windows only.
37 
38  Mostly all the definitions in this file are copied or at least based
39  on the file wx/dlimpexp.h, written by Vadim Zeitlin and published
40  under the wxWindows licence.
41 */
42 
43 #ifndef _HWIMPEXP_H
44 #define _HWIMPEXP_H
45 
46 
47 #if defined(MRPT_OS_WINDOWS)
48  /*
49  __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
50  as VC++ and gcc
51  */
52 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
53 # define HWEXPORT __declspec(dllexport)
54 # define HWIMPORT __declspec(dllimport)
55 # else /* compiler doesn't support __declspec() */
56 # define HWEXPORT
57 # define HWIMPORT
58 # endif
59 #elif defined(MRPT_OS_OS2) /* was __WXPM__ */
60 # if defined (__WATCOMC__)
61 # define HWEXPORT __declspec(dllexport)
62  /*
63  __declspec(dllimport) prepends __imp to imported symbols. We do NOT
64  want that!
65  */
66 # define HWIMPORT
67 # elif defined(__EMX__)
68 # define HWEXPORT
69 # define HWIMPORT
70 # elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
71 # define HWEXPORT _Export
72 # define HWIMPORT _Export
73 # endif
74 #elif defined(MRPT_OS_APPLE)
75 # ifdef __MWERKS__
76 # define HWEXPORT __declspec(export)
77 # define HWIMPORT __declspec(import)
78 # endif
79 #elif defined(__CYGWIN__)
80 # define HWEXPORT __declspec(dllexport)
81 # define HWIMPORT __declspec(dllimport)
82 #endif
83 
84 /* for other platforms/compilers we don't anything */
85 #ifndef HWEXPORT
86 # define HWEXPORT
87 # define HWIMPORT
88 #endif
89 
90 /*
91  HWDRIVERS_IMPEXP maps to export declaration when building the DLL, to import
92  declaration if using it or to nothing at all if we are not compiling as DLL
93  */
94 #if defined(MRPT_BUILT_AS_DLL)
95 # if defined(mrpt_hwdrivers_EXPORTS) /* Building the DLL */
96 # define HWDRIVERS_IMPEXP HWEXPORT
97 # else /* Using the DLL */
98 # define HWDRIVERS_IMPEXP HWIMPORT
99 # endif
100 #else /* not making nor using DLL */
101 # define HWDRIVERS_IMPEXP
102 #endif
103 
104 #endif /* end of _UTILSIMPEXP_H */



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