Main MRPT website > C++ reference
MRPT logo

link_pragmas.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 #ifndef base_link_pragmas_H
00030 #define base_link_pragmas_H
00031 
00032 #include <mrpt/config.h>
00033 #include <mrpt/utils/boost_join.h>
00034 
00035 // ** Important! **
00036 // In each mrpt library, search and replace:
00037 //  MRPT_XXX_EXPORT, MRPT_XXX_IMPORT
00038 //  BASE_IMPEXP, mrpt_xxx_EXPORTS
00039 
00040 // If we are building the DLL (_EXPORTS), do not link against the .lib files:
00041 #if !defined(mrpt_base_EXPORTS) && (defined(_MSC_VER) || defined(__BORLANDC__))
00042 #       if defined(_DEBUG)
00043 #               pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-base",MRPT_VERSION_POSTFIX),"-dbg.lib"))
00044 #       else
00045 #               pragma comment (lib, BOOST_JOIN( BOOST_JOIN("libmrpt-base",MRPT_VERSION_POSTFIX),".lib"))
00046 #       endif
00047 #endif
00048 
00049 
00050 
00051 
00052 /*   The macros below for DLL import/export are required for Windows only.
00053     Mostly all the definitions in this file are copied or at least based
00054      on the file wx/dlimpexp.h, written by Vadim Zeitlin and published
00055          under the wxWindows licence.
00056 */
00057 #if defined(MRPT_OS_WINDOWS)
00058     /*
00059        __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
00060        as VC++ and gcc
00061      */
00062 #    if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
00063 #        define MRPT_BASE_EXPORT __declspec(dllexport)
00064 #        define MRPT_BASE_IMPORT __declspec(dllimport)
00065 #    else /* compiler doesn't support __declspec() */
00066 #        define MRPT_BASE_EXPORT
00067 #        define MRPT_BASE_IMPORT
00068 #    endif
00069 #elif defined(MRPT_OS_OS2)              /* was __WXPM__ */
00070 #    if defined (__WATCOMC__)
00071 #        define MRPT_BASE_EXPORT __declspec(dllexport)
00072         /*
00073            __declspec(dllimport) prepends __imp to imported symbols. We do NOT
00074            want that!
00075          */
00076 #        define MRPT_BASE_IMPORT
00077 #    elif defined(__EMX__)
00078 #        define MRPT_BASE_EXPORT
00079 #        define MRPT_BASE_IMPORT
00080 #    elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
00081 #        define MRPT_BASE_EXPORT _Export
00082 #        define MRPT_BASE_IMPORT _Export
00083 #    endif
00084 #elif defined(MRPT_OS_APPLE)
00085 #    ifdef __MWERKS__
00086 #        define MRPT_BASE_EXPORT __declspec(export)
00087 #        define MRPT_BASE_IMPORT __declspec(import)
00088 #    endif
00089 #elif defined(__CYGWIN__)
00090 #    define MRPT_BASE_EXPORT __declspec(dllexport)
00091 #    define MRPT_BASE_IMPORT __declspec(dllimport)
00092 #endif
00093 
00094 /* for other platforms/compilers we don't anything */
00095 #ifndef MRPT_BASE_EXPORT
00096 #    define MRPT_BASE_EXPORT
00097 #    define MRPT_BASE_IMPORT
00098 #endif
00099 
00100 /*  Macros that map to export declaration when building the DLL, to import
00101         declaration if using it or to nothing at all if we are not compiling as DLL */
00102 #if defined(MRPT_BUILT_AS_DLL)
00103 #       if defined(mrpt_base_EXPORTS)  /* Building the DLL */
00104 #               define BASE_IMPEXP MRPT_BASE_EXPORT
00105 #       else  /* Using the DLL */
00106 #               define BASE_IMPEXP MRPT_BASE_IMPORT
00107 #       endif
00108 #else /* not making nor using DLL */
00109 #    define BASE_IMPEXP 
00110 #endif
00111 
00112 
00113 #endif



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