jeudi 30 juin 2016

C++ method declaration including a macro

I'm using QuickFAST library and while checking it I found this class declaration which I don't seem to really get ! I mean what does a macro name before the class name !

class QuickFAST_Export Message : public FieldSet

also I found this declaration

friend void QuickFAST_Export intrusive_ptr_add_ref(const Field * ptr);

and again I don't get the use of this declaration !

for more info here's the QuickFAST_Export.hpp

#ifdef _MSC_VER
# pragma once
#endif
#ifndef QUICKFAST_EXPORT_H
#define QUICKFAST_EXPORT_H

// Compile time controls for library generation.  Define with /D or #define
// To produce or use a static library: #define QUICKFAST_HAS_DLL=0
//   Default is to produce/use a DLL
// While building the QUICKFAST_ library: #define QUICKFAST_BUILD_DLL
//   Default is to export symbols from a pre-built QUICKFAST DLL
//
// Within QUICKFAST use the QuickFAST_Export macro where a __declspec is needed.

#if defined (_WIN32)

#  if !defined (QUICKFAST_HAS_DLL)
#    define QUICKFAST_HAS_DLL 1
#  endif /* ! QUICKFAST_HAS_DLL */

#  if defined (QUICKFAST_HAS_DLL) && (QUICKFAST_HAS_DLL == 1)
#    if defined (QUICKFAST_BUILD_DLL)
#      define QuickFAST_Export __declspec(dllexport)
#    else /* QUICKFAST_BUILD_DLL */
#      define QuickFAST_Export __declspec(dllimport)
#    endif /* QUICKFAST_BUILD_DLL */
#  else /* QUICKFAST_HAS_DLL == 1 */
#    define QuickFAST_Export
#  endif /* QUICKFAST_HAS_DLL == 1 */

#  else /* !_WIN32 */

Aucun commentaire:

Enregistrer un commentaire