/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: cmnExportMacros.h,v 1.16 2007/04/26 19:33:57 anton Exp $ Author(s): Anton Deguet Created on: 2001-04-11 (C) Copyright 2001-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ /*! \file \brief Macros for the creation of Visual C++ Dlls */ // clean #undef CISST_EXPORT // do it only for windows 32 OSs (95/98/me or NT/2000) and Microsoft compilers. // Note: we cannot rely on cmnPortability here because this file is, in fact, // included into cmnPortability. #if WIN32 && _MSC_VER #ifdef CISST_THIS_LIBRARY_AS_DLL // warning regarding base class not exporting, i.e. all std:: #pragma warning (disable: 4275) #define CISST_EXPORT _declspec(dllexport) #elif CISST_DLL // local and import headers // warning regarding base class not exporting, i.e. all std:: #pragma warning (disable: 4275) #define CISST_EXPORT _declspec(dllimport) #endif #endif // end windows dll stuff // for all other operating systems and windows static libraries #ifndef CISST_EXPORT #define CISST_EXPORT #endif #include // Doxygen fake code, special values #ifdef DOXYGEN #undef CISST_EXPORT /*! \brief Export a symbol for a Dll This macro is used only for the creation of Windows Dll with Visual C++. On all other operating systems or compilers, this macro does nothing. With Windows and Microsoft VC++, whenever someone needs to create a Dll, the macro expands as _declspec(dllexport). To specify that the file is used to create a Dll, the preprocessor must have \_EXPORTS defined. This value is set automatically for each library by CMake if a DLL is to be compiled. Usage: Append macros to declare exported variables, functions and classes. - A global variable in a header file: \code extern CISST_EXPORT myType myVariable; \endcode - A global function in a header file: \code CISST_EXPORT myType functionName(..); \endcode - A class in a header file: \code class CISST_EXPORT className { ... }; \endcode - For a templated class or method with inlined code only, do not use CISST_EXPORT - For a template class with no inlined code at all, use CISST_EXPORT for the class declaration - For a class mixing inlined and non inlined code, use CISST_EXPORT for the declarations of the non inlined code only When one needs to use an existing Dll, the macro must expand as _declspec(dllimport). To do so, the preprocessor must have CISST_DLL defined. Again, using CMake, this is automatically set. */ #define CISST_EXPORT "depends on the OS and compiler" #endif // Doxygen special values // **************************************************************************** // Change History // **************************************************************************** // // $Log: cmnExportMacros.h,v $ // Revision 1.16 2007/04/26 19:33:57 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.15 2006/11/20 20:33:19 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.14 2006/10/31 20:31:06 anton // cmnExportMacros.h: Add #include for cmnClassRegisterMacros.h once CISST_EXPORT // is defined. // // Revision 1.13 2006/02/04 05:18:09 pkaz // cmnExportMacros.h: fixed typos in doxygen comments. // // Revision 1.12 2006/01/03 03:33:04 anton // cisstCommon Doxygen: Use \code \endcode instead of
, updated
//  cmnTypeTraits to avoid all specialization to appear, updated CISST_DEPRECATED.
//
//  Revision 1.11  2005/10/06 16:56:37  anton
//  Doxygen: Corrected errors and some warnings detected by Doxygen 1.4.3.
//
//  Revision 1.10  2005/09/26 15:41:46  anton
//  cisst: Added modelines for emacs and vi.
//
//  Revision 1.9  2005/05/19 19:29:00  anton
//  cisst libs: Added the license to cisstCommon and cisstVector
//
//  Revision 1.8  2004/10/25 13:52:05  anton
//  Doxygen documentation:  Cleanup all the useless \ingroup.
//
//  Revision 1.7  2004/10/09 18:52:16  ofri
//  Some cleanup in cisstCommon header files.  gcc on cygwin prints a bunch of
//  warnings when it encounters #pragma warning .  Some files had that prama used
//  if WIN32 is defined, which is the case with cygwin/gcc.  I substituted that with
//  including cmnPortability and adding the warning disable that.
//
//  Revision 1.6  2004/06/14 19:19:44  anton
//  Added some documentation related to the use of CISST_EXPORT with templated
//  code, including classes with partially instantiated methods/partially
//  inlined (see ticket #26)
//
//  Revision 1.5  2003/10/03 19:09:10  anton
//  cleaned useless comments
//
//  Revision 1.4  2003/09/17 14:20:32  anton
//  changed from cmnEXPORT to CISST_EXPORT, added documentation
//
//  Revision 1.3  2003/08/14 14:55:31  anton
//  Cleanup older code from cis
//
//  Revision 1.2  2003/06/23 20:52:14  anton
//  filename changed
//
//
// ****************************************************************************