/* Copyright 2013 MathWorks, Inc. */

#ifndef CODER_TARGET_SERVICES_SPEC_HPP
#define CODER_TARGET_SERVICES_SPEC_HPP

#ifdef SUPPORTS_PRAGMA_ONCE
#pragma once
#endif

#ifdef _MSC_VER
#define DECL_DLL_EXPORT_EXP_INST(ClassInst)
#define DECL_DLL_IMPORT_EXP_INST(ClassInst)
#elif __GNUC__ >= 4
#define DECL_DLL_EXPORT_EXP_INST(ClassInst)
#define DECL_DLL_IMPORT_EXP_INST(ClassInst)    extern template class ClassInst
#else
#define DLL_EXPORT_EXP_INST(ClassInst)
#define DLL_IMPORT_EXP_INST(ClassInst)
#endif
#define DLL_EXPORT_EXP_INST_TEMPLATE DLL_EXPORT_SYM
#define DLL_IMPORT_EXP_INST_TEMPLATE DLL_IMPORT_SYM

#ifdef BUILDING_LIBMWCODER_TARGET_SERVICES

# define CODER_TARGET_SERVICES_EXPORT_CLASS               DLL_EXPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT_FCN                 DLL_EXPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT                     DLL_EXPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT_TEMPLATE            DLL_EXPORT_TEMPLATE
# define CODER_TARGET_SERVICES_EXPORT_EXP_INST_TEMPLATE   DLL_EXPORT_EXP_INST_TEMPLATE
# define CODER_TARGET_SERVICES_EXPORT_EXTERN_C            extern "C" DLL_EXPORT_SYM
# define CODER_TARGET_SERVICES_DECL_EXPORT_EXP_INST_TEMPLATE(ClassInst)  DECL_DLL_EXPORT_EXP_INST(ClassInst)

#elif defined(DLL_IMPORT_SYM)

# define CODER_TARGET_SERVICES_EXPORT_CLASS               DLL_IMPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT_FCN                 DLL_IMPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT                     DLL_IMPORT_SYM
# define CODER_TARGET_SERVICES_EXPORT_TEMPLATE            DLL_EXPORT_TEMPLATE
# define CODER_TARGET_SERVICES_EXPORT_EXP_INST_TEMPLATE   DLL_IMPORT_EXP_INST_TEMPLATE
# define CODER_TARGET_SERVICES_EXPORT_EXTERN_C            extern "C" DLL_IMPORT_SYM
# define CODER_TARGET_SERVICES_DECL_EXPORT_EXP_INST_TEMPLATE(ClassInst) DECL_DLL_IMPORT_EXP_INST(ClassInst)
#else

#ifdef __cplusplus
#define CODER_TARGET_SERVICES_EXPORT_EXTERN_C extern "C"
#else
#define CODER_TARGET_SERVICES_EXPORT_EXTERN_C extern
#endif

# define CODER_TARGET_SERVICES_EXPORT_CLASS
# define CODER_TARGET_SERVICES_EXPORT_FCN    extern
# define CODER_TARGET_SERVICES_EXPORT        extern
# define CODER_TARGET_SERVICES_EXPORT_TEMPLATE
# define CODER_TARGET_SERVICES_EXPORT_EXP_INST_TEMPLATE  
# define CODER_TARGET_SERVICES_DECL_EXPORT_EXP_INST_TEMPLATE(ClassInst)
#endif

#endif
