Browse Source

Define CARLA_API macro and use it to export some C++ classes

tags/1.9.6
falkTX 11 years ago
parent
commit
7aa321ad77
3 changed files with 26 additions and 11 deletions
  1. +1
    -1
      source/Makefile.mk
  2. +8
    -8
      source/backend/CarlaHost.h
  3. +17
    -2
      source/includes/CarlaDefines.h

+ 1
- 1
source/Makefile.mk View File

@@ -61,7 +61,7 @@ endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Common build and link flags # Common build and link flags


BASE_FLAGS = -Wall -Wextra -pipe -DREAL_BUILD
BASE_FLAGS = -Wall -Wextra -pipe -DBUILDING_CARLA -DREAL_BUILD
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -fdata-sections -ffunction-sections BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -fdata-sections -ffunction-sections
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections
LINK_OPTS += -Wl,--strip-all LINK_OPTS += -Wl,--strip-all


+ 8
- 8
source/backend/CarlaHost.h View File

@@ -135,8 +135,8 @@ typedef struct _CarlaPluginInfo {
/*! /*!
* C++ constructor and destructor. * C++ constructor and destructor.
*/ */
_CarlaPluginInfo() noexcept;
~_CarlaPluginInfo() noexcept;
CARLA_API _CarlaPluginInfo() noexcept;
CARLA_API ~_CarlaPluginInfo() noexcept;
CARLA_DECLARE_NON_COPY_STRUCT(_CarlaPluginInfo) CARLA_DECLARE_NON_COPY_STRUCT(_CarlaPluginInfo)
#endif #endif


@@ -212,7 +212,7 @@ typedef struct _CarlaCachedPluginInfo {
/*! /*!
* C++ constructor. * C++ constructor.
*/ */
_CarlaCachedPluginInfo() noexcept;
CARLA_API _CarlaCachedPluginInfo() noexcept;
CARLA_DECLARE_NON_COPY_STRUCT(_CarlaCachedPluginInfo) CARLA_DECLARE_NON_COPY_STRUCT(_CarlaCachedPluginInfo)
#endif #endif


@@ -267,8 +267,8 @@ typedef struct _CarlaParameterInfo {
/*! /*!
* C++ constructor and destructor. * C++ constructor and destructor.
*/ */
_CarlaParameterInfo() noexcept;
~_CarlaParameterInfo() noexcept;
CARLA_API _CarlaParameterInfo() noexcept;
CARLA_API ~_CarlaParameterInfo() noexcept;
CARLA_DECLARE_NON_COPY_STRUCT(_CarlaParameterInfo) CARLA_DECLARE_NON_COPY_STRUCT(_CarlaParameterInfo)
#endif #endif


@@ -293,8 +293,8 @@ typedef struct _CarlaScalePointInfo {
/*! /*!
* C++ constructor and destructor. * C++ constructor and destructor.
*/ */
_CarlaScalePointInfo() noexcept;
~_CarlaScalePointInfo() noexcept;
CARLA_API _CarlaScalePointInfo() noexcept;
CARLA_API ~_CarlaScalePointInfo() noexcept;
CARLA_DECLARE_NON_COPY_STRUCT(_CarlaScalePointInfo) CARLA_DECLARE_NON_COPY_STRUCT(_CarlaScalePointInfo)
#endif #endif


@@ -339,7 +339,7 @@ typedef struct _CarlaTransportInfo {
/*! /*!
* C++ constructor. * C++ constructor.
*/ */
_CarlaTransportInfo() noexcept;
CARLA_API _CarlaTransportInfo() noexcept;
#endif #endif


} CarlaTransportInfo; } CarlaTransportInfo;


+ 17
- 2
source/includes/CarlaDefines.h View File

@@ -220,6 +220,21 @@ private: \
static void* operator new(std::size_t); static void* operator new(std::size_t);
#endif #endif


/* Define CARLA_API */
#ifdef BUILD_BRIDGE
# define CARLA_API
#else
# if defined(CARLA_OS_WIN) && ! defined(__WINE__)
# ifdef BUILDING_CARLA
# define CARLA_API __declspec (dllexport)
# else
# define CARLA_API __declspec (imexport)
# endif
# else
# define CARLA_API __attribute__ ((visibility("default")))
# endif
#endif

/* Define CARLA_EXTERN_C */ /* Define CARLA_EXTERN_C */
#ifdef __cplusplus #ifdef __cplusplus
# define CARLA_EXTERN_C extern "C" # define CARLA_EXTERN_C extern "C"
@@ -232,9 +247,9 @@ private: \
# define CARLA_EXPORT CARLA_EXTERN_C # define CARLA_EXPORT CARLA_EXTERN_C
#else #else
# if defined(CARLA_OS_WIN) && ! defined(__WINE__) # if defined(CARLA_OS_WIN) && ! defined(__WINE__)
# define CARLA_EXPORT CARLA_EXTERN_C __declspec (dllexport)
# define CARLA_EXPORT CARLA_EXTERN_C CARLA_API
# else # else
# define CARLA_EXPORT CARLA_EXTERN_C __attribute__ ((visibility("default")))
# define CARLA_EXPORT CARLA_EXTERN_C CARLA_API
# endif # endif
#endif #endif




Loading…
Cancel
Save