Main MRPT website > C++ reference
MRPT logo

hwdrivers_impexp.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 
00029 /* This file should be included from utils_defs.h only!
00030 */
00031 #ifndef _IAMINUTILSDEFS_H
00032 #error Do not include this file manually
00033 #endif
00034 
00035 /*   This file defines macros for DLL import/export, required for
00036        Windows only.
00037 
00038     Mostly all the definitions in this file are copied or at least based
00039      on the file wx/dlimpexp.h, written by Vadim Zeitlin and published
00040          under the wxWindows licence.
00041 */
00042 
00043 #ifndef _HWIMPEXP_H
00044 #define _HWIMPEXP_H
00045 
00046 
00047 #if defined(MRPT_OS_WINDOWS)
00048     /*
00049        __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
00050        as VC++ and gcc
00051      */
00052 #    if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
00053 #        define HWEXPORT __declspec(dllexport)
00054 #        define HWIMPORT __declspec(dllimport)
00055 #    else /* compiler doesn't support __declspec() */
00056 #        define HWEXPORT
00057 #        define HWIMPORT
00058 #    endif
00059 #elif defined(MRPT_OS_OS2)              /* was __WXPM__ */
00060 #    if defined (__WATCOMC__)
00061 #        define HWEXPORT __declspec(dllexport)
00062         /*
00063            __declspec(dllimport) prepends __imp to imported symbols. We do NOT
00064            want that!
00065          */
00066 #        define HWIMPORT
00067 #    elif defined(__EMX__)
00068 #        define HWEXPORT
00069 #        define HWIMPORT
00070 #    elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
00071 #        define HWEXPORT _Export
00072 #        define HWIMPORT _Export
00073 #    endif
00074 #elif defined(MRPT_OS_APPLE)
00075 #    ifdef __MWERKS__
00076 #        define HWEXPORT __declspec(export)
00077 #        define HWIMPORT __declspec(import)
00078 #    endif
00079 #elif defined(__CYGWIN__)
00080 #    define HWEXPORT __declspec(dllexport)
00081 #    define HWIMPORT __declspec(dllimport)
00082 #endif
00083 
00084 /* for other platforms/compilers we don't anything */
00085 #ifndef HWEXPORT
00086 #    define HWEXPORT
00087 #    define HWIMPORT
00088 #endif
00089 
00090 /*
00091    HWDRIVERS_IMPEXP maps to export declaration when building the DLL, to import
00092    declaration if using it or to nothing at all if we are not compiling as DLL
00093  */
00094 #if defined(MRPT_BUILT_AS_DLL)
00095 #       if defined(mrpt_hwdrivers_EXPORTS)  /* Building the DLL */
00096 #               define HWDRIVERS_IMPEXP HWEXPORT
00097 #       else  /* Using the DLL */
00098 #               define HWDRIVERS_IMPEXP HWIMPORT
00099 #       endif
00100 #else /* not making nor using DLL */
00101 #    define HWDRIVERS_IMPEXP
00102 #endif
00103 
00104 #endif /*  end of _UTILSIMPEXP_H */



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011