add export visibility control to libpbd (works thus far on linux/gcc)

This commit is contained in:
Paul Davis 2013-10-16 23:30:28 -04:00
parent cb3abec966
commit c5115c9a3c
76 changed files with 400 additions and 213 deletions

View file

@ -26,6 +26,7 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/receiver.h" #include "pbd/receiver.h"
#include "pbd/ringbufferNPT.h" #include "pbd/ringbufferNPT.h"
#include "pbd/signals.h" #include "pbd/signals.h"

View file

@ -29,6 +29,7 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include <glibmm/main.h> #include <glibmm/main.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/crossthread.h" #include "pbd/crossthread.h"
#include "pbd/event_loop.h" #include "pbd/event_loop.h"
@ -41,7 +42,7 @@
*/ */
class BaseUI : public sigc::trackable, public PBD::EventLoop class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop
{ {
public: public:
BaseUI (const std::string& name); BaseUI (const std::string& name);

View file

@ -22,8 +22,10 @@
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
Glib::ustring basename_nosuffix (Glib::ustring); LIBPBD_API Glib::ustring basename_nosuffix (Glib::ustring);
} }
#endif /* __libpbd_basename_h__ */ #endif /* __libpbd_basename_h__ */

View file

@ -23,8 +23,10 @@
#include <ostream> #include <ostream>
void boost_debug_shared_ptr_mark_interesting (void* ptr, const char* type); #include "pbd/libpbd_visibility.h"
void boost_debug_list_ptrs ();
void boost_debug_shared_ptr_show_live_debugging (bool yn); LIBPBD_API void boost_debug_shared_ptr_mark_interesting (void* ptr, const char* type);
LIBPBD_API void boost_debug_list_ptrs ();
LIBPBD_API void boost_debug_shared_ptr_show_live_debugging (bool yn);
#endif /* __pbd_boost_debug_h__ */ #endif /* __pbd_boost_debug_h__ */

View file

@ -22,14 +22,16 @@
#include <cfloat> #include <cfloat>
#include <cmath> #include <cmath>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
void spherical_to_cartesian (double azi, double ele, double len, double& x, double& y, double& z); LIBPBD_API void spherical_to_cartesian (double azi, double ele, double len, double& x, double& y, double& z);
void cartesian_to_spherical (double x, double y, double z, double& azi, double& ele, double& len); LIBPBD_API void cartesian_to_spherical (double x, double y, double z, double& azi, double& ele, double& len);
struct AngularVector; struct AngularVector;
struct CartesianVector { struct LIBPBD_API CartesianVector {
double x; double x;
double y; double y;
double z; double z;
@ -51,10 +53,10 @@ struct CartesianVector {
return other; return other;
} }
void angular (AngularVector&) const; inline void angular (AngularVector& a) const;
}; };
struct AngularVector { struct LIBPBD_API AngularVector {
double azi; double azi;
double ele; double ele;
double length; double length;
@ -95,7 +97,7 @@ struct AngularVector {
} }
}; };
inline void CartesianVector::angular (AngularVector& a) const { LIBPBD_API inline void CartesianVector::angular (AngularVector& a) const {
cartesian_to_spherical (x, y, z, a.azi, a.ele, a.length); cartesian_to_spherical (x, y, z, a.azi, a.ele, a.length);
} }

View file

@ -24,8 +24,10 @@
#include <vector> #include <vector>
#include <sys/types.h> #include <sys/types.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
int clear_directory (const std::string&, size_t* = 0, std::vector<std::string>* = 0); LIBPBD_API int clear_directory (const std::string&, size_t* = 0, std::vector<std::string>* = 0);
} }
#endif /* __pbd_clear_dir_h__ */ #endif /* __pbd_clear_dir_h__ */

View file

@ -24,10 +24,11 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "pbd/statefuldestructible.h" #include "pbd/statefuldestructible.h"
class Command : public PBD::StatefulDestructible, public PBD::ScopedConnectionList class LIBPBD_API Command : public PBD::StatefulDestructible, public PBD::ScopedConnectionList
{ {
public: public:
virtual ~Command() { /* NOTE: derived classes must call drop_references() */ } virtual ~Command() { /* NOTE: derived classes must call drop_references() */ }

View file

@ -38,11 +38,13 @@
#include <list> #include <list>
#include <map> // for multimap #include <map> // for multimap
#include "pbd/libpbd_visibility.h"
namespace StringPrivate namespace StringPrivate
{ {
// the actual composition class - using string::compose is cleaner, so we // the actual composition class - using string::compose is cleaner, so we
// hide it here // hide it here
class Composition class LIBPBD_API Composition
{ {
public: public:
// initialize and prepare format string on the form "text %1 text %2 etc." // initialize and prepare format string on the form "text %1 text %2 etc."
@ -202,7 +204,7 @@ namespace StringPrivate
// a series of functions which accept a format string on the form "text %1 // a series of functions which accept a format string on the form "text %1
// more %2 less %3" and a number of templated parameters and spits out the // more %2 less %3" and a number of templated parameters and spits out the
// composited string // composited string
template <typename T1> template <typename T1> LIBPBD_API
inline std::string string_compose(const std::string &fmt, const T1 &o1) inline std::string string_compose(const std::string &fmt, const T1 &o1)
{ {
StringPrivate::Composition c(fmt); StringPrivate::Composition c(fmt);
@ -210,7 +212,7 @@ namespace StringPrivate
return c.str(); return c.str();
} }
template <typename T1, typename T2> template <typename T1, typename T2> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2) const T1 &o1, const T2 &o2)
{ {
@ -219,7 +221,7 @@ namespace StringPrivate
return c.str(); return c.str();
} }
template <typename T1, typename T2, typename T3> template <typename T1, typename T2, typename T3> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3) const T1 &o1, const T2 &o2, const T3 &o3)
{ {
@ -228,7 +230,7 @@ namespace StringPrivate
return c.str(); return c.str();
} }
template <typename T1, typename T2, typename T3, typename T4> template <typename T1, typename T2, typename T3, typename T4> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4) const T4 &o4)
@ -238,7 +240,7 @@ namespace StringPrivate
return c.str(); return c.str();
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5> template <typename T1, typename T2, typename T3, typename T4, typename T5> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5) const T4 &o4, const T5 &o5)
@ -249,7 +251,7 @@ namespace StringPrivate
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6> typename T6> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6) const T4 &o4, const T5 &o5, const T6 &o6)
@ -260,7 +262,7 @@ namespace StringPrivate
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7> typename T6, typename T7> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -272,7 +274,7 @@ namespace StringPrivate
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8> typename T6, typename T7, typename T8> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -284,7 +286,7 @@ namespace StringPrivate
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9> typename T6, typename T7, typename T8, typename T9> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -296,7 +298,7 @@ namespace StringPrivate
} }
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10> typename T6, typename T7, typename T8, typename T9, typename T10> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -311,7 +313,7 @@ namespace StringPrivate
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10, typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11> typename T11> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -326,7 +328,7 @@ namespace StringPrivate
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10, typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12> typename T11, typename T12> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -341,7 +343,7 @@ namespace StringPrivate
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10, typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13> typename T11, typename T12, typename T13> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -357,7 +359,7 @@ namespace StringPrivate
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10, typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14> typename T11, typename T12, typename T13, typename T14> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,
@ -374,7 +376,7 @@ namespace StringPrivate
template <typename T1, typename T2, typename T3, typename T4, typename T5, template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10, typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14, typename T11, typename T12, typename T13, typename T14,
typename T15> typename T15> LIBPBD_API
inline std::string string_compose(const std::string &fmt, inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6, const T4 &o4, const T5 &o5, const T6 &o6,

View file

@ -24,6 +24,7 @@
#include <set> #include <set>
#include <map> #include <map>
#include "pbd/libpbd_visibility.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include <glibmm/threads.h> #include <glibmm/threads.h>
@ -33,7 +34,7 @@ class XMLNode;
namespace PBD { namespace PBD {
class Controllable : public PBD::StatefulDestructible { class LIBPBD_API Controllable : public PBD::StatefulDestructible {
public: public:
enum Flag { enum Flag {
Toggle = 0x1, Toggle = 0x1,
@ -113,7 +114,7 @@ class Controllable : public PBD::StatefulDestructible {
a Controllable a Controllable
*/ */
class IgnorableControllable : public Controllable class LIBPBD_API IgnorableControllable : public Controllable
{ {
public: public:
IgnorableControllable () : PBD::Controllable ("ignoreMe") {} IgnorableControllable () : PBD::Controllable ("ignoreMe") {}

View file

@ -23,9 +23,11 @@
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class ControllableDescriptor { class LIBPBD_API ControllableDescriptor {
public: public:
enum TopLevelType { enum TopLevelType {
RemoteControlID, RemoteControlID,

View file

@ -27,25 +27,27 @@
#include <iostream> #include <iostream>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
std::string short_version (std::string, std::string::size_type target_length); LIBPBD_API std::string short_version (std::string, std::string::size_type target_length);
int atoi (const std::string&); LIBPBD_API int atoi (const std::string&);
int32_t atol (const std::string&); LIBPBD_API int32_t atol (const std::string&);
int64_t atoll (const std::string&); LIBPBD_API int64_t atoll (const std::string&);
double atof (const std::string&); LIBPBD_API double atof (const std::string&);
std::string url_decode (std::string const &); LIBPBD_API std::string url_decode (std::string const &);
std::string capitalize (const std::string&); LIBPBD_API std::string capitalize (const std::string&);
// std::string length2string (const int32_t frames, const float sample_rate); // std::string length2string (const int32_t frames, const float sample_rate);
std::string length2string (const int64_t frames, const double sample_rate); LIBPBD_API std::string length2string (const int64_t frames, const double sample_rate);
std::vector<std::string> internationalize (const char *, const char **); LIBPBD_API std::vector<std::string> internationalize (const char *, const char **);
bool strings_equal_ignore_case (const std::string& a, const std::string& b); LIBPBD_API bool strings_equal_ignore_case (const std::string& a, const std::string& b);
template <class T> std::string template <class T> std::string LIBPBD_API
to_string (T t, std::ios_base & (*f)(std::ios_base&)) to_string (T t, std::ios_base & (*f)(std::ios_base&))
{ {
std::ostringstream oss; std::ostringstream oss;
@ -53,10 +55,9 @@ to_string (T t, std::ios_base & (*f)(std::ios_base&))
return oss.str(); return oss.str();
} }
bool string_is_affirmative (const std::string&); LIBPBD_API bool string_is_affirmative (const std::string&);
const char * LIBPBD_API const char* sgettext (const char *, const char *);
sgettext (const char *, const char *);
} //namespace PBD } //namespace PBD

View file

@ -23,6 +23,8 @@
#include <stdint.h> #include <stdint.h>
extern uint32_t hardware_concurrency (); #include "pbd/libpbd_visibility.h"
LIBPBD_API extern uint32_t hardware_concurrency ();
#endif /* __libpbd_cpus_h__ */ #endif /* __libpbd_cpus_h__ */

View file

@ -26,6 +26,8 @@
#include <glibmm/main.h> #include <glibmm/main.h>
#include "pbd/libpbd_visibility.h"
/** A simple abstraction of a mechanism of signalling one thread from another. /** A simple abstraction of a mechanism of signalling one thread from another.
* The signaller calls ::wakeup() to tell the signalled thread to check for * The signaller calls ::wakeup() to tell the signalled thread to check for
* work to be done. * work to be done.
@ -35,7 +37,7 @@
* in Glib main loop based situations. * in Glib main loop based situations.
*/ */
class CrossThreadChannel { class LIBPBD_API CrossThreadChannel {
public: public:
/** if @a non_blocking is true, the channel will not cause blocking /** if @a non_blocking is true, the channel will not cause blocking
* when used in an event loop based on poll/select or the glib main * when used in an event loop based on poll/select or the glib main

View file

@ -24,25 +24,27 @@
#include <sstream> #include <sstream>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
extern uint64_t debug_bits; LIBPBD_API extern uint64_t debug_bits;
uint64_t new_debug_bit (const char* name); LIBPBD_API uint64_t new_debug_bit (const char* name);
void debug_print (const char* prefix, std::string str); LIBPBD_API void debug_print (const char* prefix, std::string str);
void set_debug_bits (uint64_t bits); LIBPBD_API void set_debug_bits (uint64_t bits);
int parse_debug_options (const char* str); LIBPBD_API int parse_debug_options (const char* str);
void list_debug_options (); LIBPBD_API void list_debug_options ();
namespace DEBUG { namespace DEBUG {
/* this namespace is so that we can write DEBUG::bit_name */ /* this namespace is so that we can write DEBUG::bit_name */
extern uint64_t Stateful; LIBPBD_API extern uint64_t Stateful;
extern uint64_t Properties; LIBPBD_API extern uint64_t Properties;
extern uint64_t FileManager; LIBPBD_API extern uint64_t FileManager;
extern uint64_t Pool; LIBPBD_API extern uint64_t Pool;
extern uint64_t EventLoop; LIBPBD_API extern uint64_t EventLoop;
extern uint64_t AbstractUI; LIBPBD_API extern uint64_t AbstractUI;
} }
} }

View file

@ -22,18 +22,20 @@
#ifndef __pbd_debug_rt_alloc_h__ #ifndef __pbd_debug_rt_alloc_h__
#define __pbd_debug_rt_alloc_h__ #define __pbd_debug_rt_alloc_h__
#include "pbd/libpbd_visibility.h"
extern "C" { extern "C" {
/** Should be set to point to a function which returns non-0 if a malloc is /** Should be set to point to a function which returns non-0 if a malloc is
* allowed in the current situation, or 0 if not. * allowed in the current situation, or 0 if not.
*/ */
extern int (*pbd_alloc_allowed) (); LIBPBD_API extern int (*pbd_alloc_allowed) ();
/** Call this to suspend malloc checking until a call to resume_rt_malloc_checks */ /** Call this to suspend malloc checking until a call to resume_rt_malloc_checks */
extern void suspend_rt_malloc_checks (); LIBPBD_API extern void suspend_rt_malloc_checks ();
/** Resume malloc checking after a suspension */ /** Resume malloc checking after a suspension */
extern void resume_rt_malloc_checks (); LIBPBD_API extern void resume_rt_malloc_checks ();
} }

View file

@ -28,9 +28,11 @@
#include <cxxabi.h> #include <cxxabi.h>
#endif #endif
#include "pbd/libpbd_visibility.h"
namespace PBD namespace PBD
{ {
template<typename T> template<typename T> LIBPBD_API
std::string demangled_name (T const & obj) std::string demangled_name (T const & obj)
{ {
#ifdef __GNUC__ #ifdef __GNUC__

View file

@ -21,10 +21,11 @@
#define __pbd_destructible_h__ #define __pbd_destructible_h__
#include "pbd/signals.h" #include "pbd/signals.h"
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class Destructible { class LIBPBD_API Destructible {
public: public:
Destructible() {} Destructible() {}
virtual ~Destructible () { Destroyed(); } virtual ~Destructible () { Destroyed(); }

View file

@ -27,9 +27,11 @@
#include <exception> #include <exception>
#include <sstream> #include <sstream>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class unknown_enumeration : public std::exception { class LIBPBD_API unknown_enumeration : public std::exception {
public: public:
unknown_enumeration (std::string const & e) throw() { unknown_enumeration (std::string const & e) throw() {
std::stringstream s; std::stringstream s;
@ -47,7 +49,7 @@ private:
std::string _message; std::string _message;
}; };
class EnumWriter { class LIBPBD_API EnumWriter {
public: public:
static EnumWriter& instance(); static EnumWriter& instance();
static void destroy(); static void destroy();

View file

@ -23,9 +23,11 @@
#include <map> #include <map>
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class EnvironmentalProtectionAgency { class LIBPBD_API EnvironmentalProtectionAgency {
public: public:
EnvironmentalProtectionAgency (bool arm = true, const std::string& envname = std::string()); EnvironmentalProtectionAgency (bool arm = true, const std::string& envname = std::string());
~EnvironmentalProtectionAgency (); ~EnvironmentalProtectionAgency ();

View file

@ -19,13 +19,14 @@
#ifndef __libpbd_error_h__ #ifndef __libpbd_error_h__
#define __libpbd_error_h__ #define __libpbd_error_h__
#include "pbd/libpbd_visibility.h"
#include "transmitter.h" #include "transmitter.h"
namespace PBD { namespace PBD {
extern Transmitter error; LIBPBD_API extern Transmitter error;
extern Transmitter info; LIBPBD_API extern Transmitter info;
extern Transmitter warning; LIBPBD_API extern Transmitter warning;
extern Transmitter fatal; LIBPBD_API extern Transmitter fatal;
} }
#endif // __libpbd_error_h__ #endif // __libpbd_error_h__

View file

@ -24,6 +24,8 @@
#include <boost/bind.hpp> /* we don't need this here, but anything calling call_slot() probably will, so this is convenient */ #include <boost/bind.hpp> /* we don't need this here, but anything calling call_slot() probably will, so this is convenient */
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
namespace PBD namespace PBD
{ {
@ -36,7 +38,7 @@ namespace PBD
* when something like this is needed (it inherits from EventLoop). * when something like this is needed (it inherits from EventLoop).
*/ */
class EventLoop class LIBPBD_API EventLoop
{ {
public: public:
EventLoop() {} EventLoop() {}

View file

@ -22,7 +22,9 @@
#include <exception> #include <exception>
class failed_constructor : public std::exception { #include "pbd/libpbd_visibility.h"
class LIBPBD_API failed_constructor : public std::exception {
public: public:
virtual const char *what() const throw() { return "failed constructor"; } virtual const char *what() const throw() { return "failed constructor"; }
}; };

View file

@ -10,7 +10,9 @@ as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#include <math.h> /* for HUGE_VAL */ #include <math.h> /* for HUGE_VAL */
static inline float fast_log2 (float val) #include "pbd/libpbd_visibility.h"
LIBPBD_API static inline float fast_log2 (float val)
{ {
/* don't use reinterpret_cast<> because that prevents this /* don't use reinterpret_cast<> because that prevents this
from being used by pure C code (for example, GnomeCanvasItems) from being used by pure C code (for example, GnomeCanvasItems)
@ -29,16 +31,16 @@ static inline float fast_log2 (float val)
return (val + log_2); return (val + log_2);
} }
static inline float fast_log (const float val) LIBPBD_API static inline float fast_log (const float val)
{ {
return (fast_log2 (val) * 0.69314718f); return (fast_log2 (val) * 0.69314718f);
} }
static inline float fast_log10 (const float val) LIBPBD_API static inline float fast_log10 (const float val)
{ {
return fast_log2(val) / 3.312500f; return fast_log2(val) / 3.312500f;
} }
static inline float minus_infinity(void) { return -HUGE_VAL; } LIBPBD_API static inline float minus_infinity(void) { return -HUGE_VAL; }
#endif /* __pbd_fastlog_h__ */ #endif /* __pbd_fastlog_h__ */

View file

@ -25,11 +25,13 @@
#include <map> #include <map>
#include <list> #include <list>
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/signals.h" #include "pbd/signals.h"
namespace PBD { namespace PBD {
class FileManager; class LIBPBD_API FileManager;
/** Parent class for FileDescriptors. /** Parent class for FileDescriptors.
* *
@ -45,7 +47,7 @@ class FileManager;
* open files to stay within limits imposed by the operating system. * open files to stay within limits imposed by the operating system.
*/ */
class FileDescriptor class LIBPBD_API FileDescriptor
{ {
public: public:
FileDescriptor (std::string const &, bool); FileDescriptor (std::string const &, bool);
@ -86,7 +88,7 @@ private:
/** FileDescriptor for a file to be opened using POSIX open */ /** FileDescriptor for a file to be opened using POSIX open */
class FdFileDescriptor : public FileDescriptor class LIBPBD_API FdFileDescriptor : public FileDescriptor
{ {
public: public:
FdFileDescriptor (std::string const & file_name, bool writeable, mode_t mode); FdFileDescriptor (std::string const & file_name, bool writeable, mode_t mode);
@ -107,7 +109,7 @@ private:
}; };
/** FileDescriptor for a file opened using stdio */ /** FileDescriptor for a file opened using stdio */
class StdioFileDescriptor : public FileDescriptor class LIBPBD_API StdioFileDescriptor : public FileDescriptor
{ {
public: public:
StdioFileDescriptor (std::string const & file_name, std::string const & mode); StdioFileDescriptor (std::string const & file_name, std::string const & mode);
@ -129,7 +131,7 @@ private:
/** Class to limit the number of files held open */ /** Class to limit the number of files held open */
class FileManager class LIBPBD_API FileManager
{ {
public: public:
FileManager (); FileManager ();

View file

@ -28,9 +28,11 @@
#include <cmath> #include <cmath>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
union Float_t union LIBPBD_API Float_t
{ {
Float_t (float num = 0.0f) : f(num) {} Float_t (float num = 0.0f) : f(num) {}
@ -45,7 +47,7 @@ union Float_t
/* Note: ULPS = Units in the Last Place */ /* Note: ULPS = Units in the Last Place */
static inline bool floateq (float a, float b, int max_ulps_diff) LIBPBD_API static inline bool floateq (float a, float b, int max_ulps_diff)
{ {
Float_t ua (a); Float_t ua (a);
Float_t ub (b); Float_t ub (b);

View file

@ -22,7 +22,9 @@
#include <unistd.h> #include <unistd.h>
pid_t forkexec(char **argv, char **envp, int outpipe[2], int inpipe[2]); #include "pbd/libpbd_visibility.h"
pid_t forkexec_cmd(char *cmd, char **envp, int outpipe[2], int inpipe[2]);
LIBPBD_API pid_t forkexec(char **argv, char **envp, int outpipe[2], int inpipe[2]);
LIBPBD_API pid_t forkexec_cmd(char *cmd, char **envp, int outpipe[2], int inpipe[2]);
#endif // __forkexec_h__ #endif // __forkexec_h__

View file

@ -20,10 +20,11 @@
#ifndef __pbd_fpu_h__ #ifndef __pbd_fpu_h__
#define __pbd_fpu_h__ #define __pbd_fpu_h__
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class LIBPBD_API FPU {
class FPU {
private: private:
enum Flags { enum Flags {
HasFlushToZero = 0x1, HasFlushToZero = 0x1,

View file

@ -25,6 +25,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include "pbd/libpbd_visibility.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/shiva.h" #include "pbd/shiva.h"
#include "pbd/command.h" #include "pbd/command.h"
@ -36,7 +37,7 @@
namespace PBD { namespace PBD {
template <class obj_type, class arg_type> template <class obj_type, class arg_type>
class FunctorCommand : public Command class LIBPBD_API FunctorCommand : public Command
{ {
private: private:
typedef void (obj_type::*functor_type)(arg_type); typedef void (obj_type::*functor_type)(arg_type);

View file

@ -25,9 +25,11 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class ID { class LIBPBD_API ID {
public: public:
ID (); ID ();
ID (std::string); ID (std::string);
@ -68,6 +70,7 @@ class ID {
}; };
} }
std::ostream& operator<< (std::ostream& ostr, const PBD::ID&);
LIBPBD_API std::ostream& operator<< (std::ostream& ostr, const PBD::ID&);
#endif /* __pbd_id_h__ */ #endif /* __pbd_id_h__ */

View file

@ -0,0 +1,58 @@
/*
Copyright (C) 2013 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __libpbd_libpbd_visibility_h__
#define __libpbd_libpbd_visibility_h__
/* _WIN32 is defined by most compilers targetting Windows, but within the
* ardour source tree, we also define COMPILER_MSVC or COMPILER_MINGW depending
* on how a Windows build is built.
*/
#if defined _WIN32 || defined __CYGWIN__ || defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
#define LIBPBD_DLL_IMPORT __declspec(dllimport)
#define LIBPBD_DLL_EXPORT __declspec(dllexport)
#define LIBPBD_DLL_LOCAL
#else
#if __GNUC__ >= 4
#define LIBPBD_DLL_IMPORT __attribute__ ((visibility ("default")))
#define LIBPBD_DLL_EXPORT __attribute__ ((visibility ("default")))
#define LIBPBD_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define LIBPBD_DLL_IMPORT
#define LIBPBD_DLL_EXPORT
#define LIBPBD_DLL_LOCAL
#define LIBPBD_DLL_IMPORT_CLASS
#define LIBPBD_DLL_EXPORT_CLASS
#endif
#endif
#ifdef LIBPBD_DLL // libpbd is a DLL
#ifdef LIBPBD_DLL_EXPORTS // defined if we are building the libpbd DLL (instead of using it)
#define LIBPBD_API LIBPBD_DLL_EXPORT
#else
#define LIBPBD_API LIBPBD_DLL_IMPORT
#endif
#define LIBPBD_LOCAL LIBPBD_DLL_LOCAL
#else /* static lib, not DLL */
#define LIBPBD_API
#define LIBPBD_LOCAL
#endif
#endif /* __libpbd_libpbd_visibility_h__ */

View file

@ -20,9 +20,11 @@
#ifndef __pbd_locale_guard__ #ifndef __pbd_locale_guard__
#define __pbd_locale_guard__ #define __pbd_locale_guard__
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
struct LocaleGuard { struct LIBPBD_API LocaleGuard {
LocaleGuard (const char*); LocaleGuard (const char*);
~LocaleGuard (); ~LocaleGuard ();
const char* old; const char* old;

View file

@ -22,6 +22,8 @@
#include <stdlib.h> #include <stdlib.h>
int cache_aligned_malloc (void** memptr, size_t size); #include "pbd/libpbd_visibility.h"
LIBPBD_API int cache_aligned_malloc (void** memptr, size_t size);
#endif /* __pbd_malign_h__ */ #endif /* __pbd_malign_h__ */

View file

@ -23,6 +23,7 @@
#include <iostream> #include <iostream>
#include "pbd/libpbd_visibility.h"
#include "pbd/command.h" #include "pbd/command.h"
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
@ -49,7 +50,7 @@
* references to non-existant crossfades. To get around this, CrossfadeBinder * references to non-existant crossfades. To get around this, CrossfadeBinder
* can do `just-in-time' binding from the crossfade ID. * can do `just-in-time' binding from the crossfade ID.
*/ */
template <class obj_T> template <class obj_T> LIBPBD_API
class MementoCommandBinder : public PBD::Destructible class MementoCommandBinder : public PBD::Destructible
{ {
public: public:
@ -66,7 +67,7 @@ public:
}; };
/** A simple MementoCommandBinder which binds directly to an object */ /** A simple MementoCommandBinder which binds directly to an object */
template <class obj_T> template <class obj_T> LIBPBD_API
class SimpleMementoCommandBinder : public MementoCommandBinder<obj_T> class SimpleMementoCommandBinder : public MementoCommandBinder<obj_T>
{ {
public: public:
@ -98,7 +99,7 @@ private:
* (from Stateful::get_state()), so undo becomes restoring the before * (from Stateful::get_state()), so undo becomes restoring the before
* memento, and redo is restoring the after memento. * memento, and redo is restoring the after memento.
*/ */
template <class obj_T> template <class obj_T> LIBPBD_API
class MementoCommand : public Command class MementoCommand : public Command
{ {
public: public:

View file

@ -22,6 +22,8 @@
#include <string> #include <string>
std::string mountpoint (std::string path); #include "pbd/libpbd_visibility.h"
LIBPBD_API std::string mountpoint (std::string path);
#endif // __pbd_mountpoint_h__ #endif // __pbd_mountpoint_h__

View file

@ -22,9 +22,11 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
bool open_uri (const char*); LIBPBD_API bool open_uri (const char*);
bool open_uri (const std::string&); LIBPBD_API bool open_uri (const std::string&);
} }
#endif #endif

View file

@ -21,9 +21,11 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
std::string path_expand (std::string path); LIBPBD_API std::string path_expand (std::string path);
std::string search_path_expand (std::string path); LIBPBD_API std::string search_path_expand (std::string path);
} }
#endif /* __libpbd_path_expand_h__ */ #endif /* __libpbd_path_expand_h__ */

View file

@ -24,7 +24,9 @@
#include <string> #include <string>
#include <regex.h> #include <regex.h>
class PathScanner #include "pbd/libpbd_visibility.h"
class LIBPBD_API PathScanner
{ {
public: public:

View file

@ -20,10 +20,12 @@
#ifndef __libpbd_pbd_h__ #ifndef __libpbd_pbd_h__
#define __libpbd_pbd_h__ #define __libpbd_pbd_h__
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
bool init (); LIBPBD_API bool init ();
void cleanup (); LIBPBD_API void cleanup ();
} // namespace PBD } // namespace PBD

View file

@ -25,12 +25,13 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/ringbuffer.h" #include "pbd/ringbuffer.h"
/** A pool of data items that can be allocated, read from and written to /** A pool of data items that can be allocated, read from and written to
* without system memory allocation or locking. * without system memory allocation or locking.
*/ */
class Pool class LIBPBD_API Pool
{ {
public: public:
Pool (std::string name, unsigned long item_size, unsigned long nitems); Pool (std::string name, unsigned long item_size, unsigned long nitems);
@ -49,7 +50,7 @@ class Pool
void *block; ///< data storage area void *block; ///< data storage area
}; };
class SingleAllocMultiReleasePool : public Pool class LIBPBD_API SingleAllocMultiReleasePool : public Pool
{ {
public: public:
SingleAllocMultiReleasePool (std::string name, unsigned long item_size, unsigned long nitems); SingleAllocMultiReleasePool (std::string name, unsigned long item_size, unsigned long nitems);
@ -63,7 +64,7 @@ class SingleAllocMultiReleasePool : public Pool
}; };
class MultiAllocSingleReleasePool : public Pool class LIBPBD_API MultiAllocSingleReleasePool : public Pool
{ {
public: public:
MultiAllocSingleReleasePool (std::string name, unsigned long item_size, unsigned long nitems); MultiAllocSingleReleasePool (std::string name, unsigned long item_size, unsigned long nitems);
@ -76,7 +77,7 @@ class MultiAllocSingleReleasePool : public Pool
Glib::Threads::Mutex m_lock; Glib::Threads::Mutex m_lock;
}; };
class PerThreadPool; class LIBPBD_API PerThreadPool;
/** Management of a per-thread pool of data that is allocated by one thread and /** Management of a per-thread pool of data that is allocated by one thread and
* freed by one other thread. Not safe for use when there is more than 1 * freed by one other thread. Not safe for use when there is more than 1
@ -90,7 +91,7 @@ class PerThreadPool;
* data), and so it calls alloc(), passes a pointer to the result of the alloc * data), and so it calls alloc(), passes a pointer to the result of the alloc
* to another thread, which later calls push() to "free" it. * to another thread, which later calls push() to "free" it.
*/ */
class CrossThreadPool : public Pool class LIBPBD_API CrossThreadPool : public Pool
{ {
public: public:
CrossThreadPool (std::string n, unsigned long isize, unsigned long nitems, PerThreadPool *); CrossThreadPool (std::string n, unsigned long isize, unsigned long nitems, PerThreadPool *);
@ -112,7 +113,7 @@ class CrossThreadPool : public Pool
/** A class to manage per-thread pools of memory. One object of this class is instantiated, /** A class to manage per-thread pools of memory. One object of this class is instantiated,
* and then it is used to create per-thread pools for 1 or more threads as required. * and then it is used to create per-thread pools for 1 or more threads as required.
*/ */
class PerThreadPool class LIBPBD_API PerThreadPool
{ {
public: public:
PerThreadPool (); PerThreadPool ();

View file

@ -26,6 +26,7 @@
#include <set> #include <set>
#include <iostream> #include <iostream>
#include "pbd/libpbd_visibility.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/property_basics.h" #include "pbd/property_basics.h"
#include "pbd/property_list.h" #include "pbd/property_list.h"
@ -36,7 +37,7 @@ namespace PBD {
/** Parent class for classes which represent a single scalar property in a Stateful object */ /** Parent class for classes which represent a single scalar property in a Stateful object */
template<class T> template<class T>
class PropertyTemplate : public PropertyBase class LIBPBD_API PropertyTemplate : public PropertyBase
{ {
public: public:
PropertyTemplate (PropertyDescriptor<T> p, T const& v) PropertyTemplate (PropertyDescriptor<T> p, T const& v)
@ -196,7 +197,7 @@ private:
PropertyTemplate (PropertyTemplate<T> const &); PropertyTemplate (PropertyTemplate<T> const &);
}; };
template<class T> template<class T> LIBPBD_API
std::ostream & operator<<(std::ostream& os, PropertyTemplate<T> const& s) std::ostream & operator<<(std::ostream& os, PropertyTemplate<T> const& s)
{ {
return os << s.val (); return os << s.val ();
@ -206,7 +207,7 @@ std::ostream & operator<<(std::ostream& os, PropertyTemplate<T> const& s)
* with types that can be written to / read from stringstreams. * with types that can be written to / read from stringstreams.
*/ */
template<class T> template<class T>
class Property : public PropertyTemplate<T> class LIBPBD_API Property : public PropertyTemplate<T>
{ {
public: public:
Property (PropertyDescriptor<T> q, T const& v) Property (PropertyDescriptor<T> q, T const& v)
@ -284,7 +285,7 @@ private:
* separators, etc. * separators, etc.
*/ */
template<> template<>
class Property<std::string> : public PropertyTemplate<std::string> class LIBPBD_API Property<std::string> : public PropertyTemplate<std::string>
{ {
public: public:
Property (PropertyDescriptor<std::string> d, std::string const & v) Property (PropertyDescriptor<std::string> d, std::string const & v)
@ -318,7 +319,7 @@ private:
}; };
template<class T> template<class T>
class EnumProperty : public Property<T> class LIBPBD_API EnumProperty : public Property<T>
{ {
public: public:
EnumProperty (PropertyDescriptor<T> q, T const& v) EnumProperty (PropertyDescriptor<T> q, T const& v)
@ -351,7 +352,7 @@ private:
* one. * one.
*/ */
template <class T> template <class T>
class SharedStatefulProperty : public PropertyBase class LIBPBD_API SharedStatefulProperty : public PropertyBase
{ {
public: public:
typedef boost::shared_ptr<T> Ptr; typedef boost::shared_ptr<T> Ptr;

View file

@ -24,20 +24,21 @@
#include <set> #include <set>
#include <vector> #include <vector>
#include "pbd/libpbd_visibility.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
class Command; class Command;
namespace PBD { namespace PBD {
class PropertyList; class LIBPBD_API PropertyList;
class StatefulDiffCommand; class LIBPBD_API StatefulDiffCommand;
/** A unique identifier for a property of a Stateful object */ /** A unique identifier for a property of a Stateful object */
typedef GQuark PropertyID; typedef GQuark PropertyID;
template<typename T> template<typename T>
struct PropertyDescriptor { struct LIBPBD_API PropertyDescriptor {
PropertyDescriptor () : property_id (0) {} PropertyDescriptor () : property_id (0) {}
PropertyDescriptor (PropertyID pid) : property_id (pid) {} PropertyDescriptor (PropertyID pid) : property_id (pid) {}
@ -46,7 +47,7 @@ struct PropertyDescriptor {
}; };
/** A list of IDs of Properties that have changed in some situation or other */ /** A list of IDs of Properties that have changed in some situation or other */
class PropertyChange : public std::set<PropertyID> class LIBPBD_API PropertyChange : public std::set<PropertyID>
{ {
public: public:
PropertyChange() {} PropertyChange() {}
@ -83,7 +84,7 @@ public:
* - to handle current state (when serializing Stateful objects) * - to handle current state (when serializing Stateful objects)
* - to handle history since some operation was started (when making StatefulDiffCommands for undo) * - to handle history since some operation was started (when making StatefulDiffCommands for undo)
*/ */
class PropertyBase class LIBPBD_API PropertyBase
{ {
public: public:
PropertyBase (PropertyID pid) PropertyBase (PropertyID pid)

View file

@ -22,6 +22,7 @@
#include <map> #include <map>
#include "pbd/libpbd_visibility.h"
#include "pbd/property_basics.h" #include "pbd/property_basics.h"
class XMLNode; class XMLNode;
@ -29,7 +30,7 @@ class XMLNode;
namespace PBD { namespace PBD {
/** A list of properties, mapped using their ID */ /** A list of properties, mapped using their ID */
class PropertyList : public std::map<PropertyID, PropertyBase*> class LIBPBD_API PropertyList : public std::map<PropertyID, PropertyBase*>
{ {
public: public:
PropertyList (); PropertyList ();
@ -61,7 +62,7 @@ protected:
* own Properties store them in an OwnedPropertyList * own Properties store them in an OwnedPropertyList
* to avoid having them deleted at the wrong time. * to avoid having them deleted at the wrong time.
*/ */
class OwnedPropertyList : public PropertyList class LIBPBD_API OwnedPropertyList : public PropertyList
{ {
public: public:
OwnedPropertyList(); OwnedPropertyList();

View file

@ -25,18 +25,19 @@
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
#include <pbd/signals.h> #include "pbd/libpbd_visibility.h"
#include "pbd/signals.h"
int pthread_create_and_store (std::string name, pthread_t *thread, void * (*start_routine)(void *), void * arg); LIBPBD_API int pthread_create_and_store (std::string name, pthread_t *thread, void * (*start_routine)(void *), void * arg);
void pthread_cancel_one (pthread_t thread); LIBPBD_API void pthread_cancel_one (pthread_t thread);
void pthread_cancel_all (); LIBPBD_API void pthread_cancel_all ();
void pthread_kill_all (int signum); LIBPBD_API void pthread_kill_all (int signum);
const char* pthread_name (); LIBPBD_API const char* pthread_name ();
void pthread_set_name (const char* name); LIBPBD_API void pthread_set_name (const char* name);
namespace PBD { namespace PBD {
extern void notify_gui_about_thread_creation (std::string, pthread_t, std::string, int requests = 256); LIBPBD_API extern void notify_gui_about_thread_creation (std::string, pthread_t, std::string, int requests = 256);
extern PBD::Signal4<void,std::string,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize; LIBPBD_API extern PBD::Signal4<void,std::string,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
} }
#endif /* __pbd_pthread_utils__ */ #endif /* __pbd_pthread_utils__ */

View file

@ -25,6 +25,8 @@
#include <list> #include <list>
#include "pbd/libpbd_visibility.h"
/** @file Defines a set of classes to implement Read-Copy-Update. We do not attempt to define RCU here - use google. /** @file Defines a set of classes to implement Read-Copy-Update. We do not attempt to define RCU here - use google.
The design consists of two parts: an RCUManager and an RCUWriter. The design consists of two parts: an RCUManager and an RCUWriter.
@ -43,7 +45,7 @@
and managed object. and managed object.
*/ */
template<class T> template<class T>
class RCUManager class LIBPBD_API RCUManager
{ {
public: public:
@ -109,7 +111,7 @@ class RCUManager
means that no actual objects will be deleted incorrectly if this is misused. means that no actual objects will be deleted incorrectly if this is misused.
*/ */
template<class T> template<class T>
class SerializedRCUManager : public RCUManager<T> class LIBPBD_API SerializedRCUManager : public RCUManager<T>
{ {
public: public:
@ -212,7 +214,7 @@ private:
*/ */
template<class T> template<class T>
class RCUWriter class LIBPBD_API RCUWriter
{ {
public: public:

View file

@ -24,11 +24,12 @@
#include <sigc++/sigc++.h> #include <sigc++/sigc++.h>
#include "pbd/libpbd_visibility.h"
#include "transmitter.h" #include "transmitter.h"
class strstream; class strstream;
class Receiver : public sigc::trackable class LIBPBD_API Receiver : public sigc::trackable
{ {
public: public:
Receiver (); Receiver ();

View file

@ -22,6 +22,8 @@
#include <string> #include <string>
int replace_all (std::string& str, const std::string& target, const std::string& replacement); #include "pbd/libpbd_visibility.h"
LIBPBD_API int replace_all (std::string& str, const std::string& target, const std::string& replacement);
#endif // __pbd_replace_all_h__ #endif // __pbd_replace_all_h__

View file

@ -23,8 +23,10 @@
#include <cstring> #include <cstring>
#include <glib.h> #include <glib.h>
#include "pbd/libpbd_visibility.h"
template<class T> template<class T>
class RingBuffer class LIBPBD_API RingBuffer
{ {
public: public:
RingBuffer (guint sz) { RingBuffer (guint sz) {
@ -118,7 +120,7 @@ class RingBuffer
guint size_mask; guint size_mask;
}; };
template<class T> guint template<class T> LIBPBD_API guint
RingBuffer<T>::read (T *dest, guint cnt) RingBuffer<T>::read (T *dest, guint cnt)
{ {
guint free_cnt; guint free_cnt;
@ -157,7 +159,7 @@ RingBuffer<T>::read (T *dest, guint cnt)
return to_read; return to_read;
} }
template<class T> guint template<class T> LIBPBD_API guint
RingBuffer<T>::write (T const *src, guint cnt) RingBuffer<T>::write (T const *src, guint cnt)
{ {
@ -197,7 +199,7 @@ RingBuffer<T>::write (T const *src, guint cnt)
return to_write; return to_write;
} }
template<class T> void template<class T> LIBPBD_API void
RingBuffer<T>::get_read_vector (RingBuffer<T>::rw_vector *vec) RingBuffer<T>::get_read_vector (RingBuffer<T>::rw_vector *vec)
{ {
@ -238,7 +240,7 @@ RingBuffer<T>::get_read_vector (RingBuffer<T>::rw_vector *vec)
} }
} }
template<class T> void template<class T> LIBPBD_API void
RingBuffer<T>::get_write_vector (RingBuffer<T>::rw_vector *vec) RingBuffer<T>::get_write_vector (RingBuffer<T>::rw_vector *vec)
{ {

View file

@ -25,12 +25,14 @@
#include <cstring> #include <cstring>
#include <glib.h> #include <glib.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
/* ringbuffer class where the element size is not required to be a power of two */ /* ringbuffer class where the element size is not required to be a power of two */
template<class T> template<class T>
class RingBufferNPT class LIBPBD_API RingBufferNPT
{ {
public: public:
RingBufferNPT (size_t sz) { RingBufferNPT (size_t sz) {
@ -118,7 +120,7 @@ class RingBufferNPT
mutable gint read_ptr; mutable gint read_ptr;
}; };
template<class T> size_t template<class T> LIBPBD_API size_t
RingBufferNPT<T>::read (T *dest, size_t cnt) RingBufferNPT<T>::read (T *dest, size_t cnt)
{ {
size_t free_cnt; size_t free_cnt;
@ -157,7 +159,7 @@ RingBufferNPT<T>::read (T *dest, size_t cnt)
return to_read; return to_read;
} }
template<class T> size_t template<class T> LIBPBD_API size_t
RingBufferNPT<T>::write (const T *src, size_t cnt) RingBufferNPT<T>::write (const T *src, size_t cnt)
{ {
size_t free_cnt; size_t free_cnt;
@ -196,7 +198,7 @@ RingBufferNPT<T>::write (const T *src, size_t cnt)
return to_write; return to_write;
} }
template<class T> void template<class T> LIBPBD_API void
RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec) RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
{ {
size_t free_cnt; size_t free_cnt;
@ -236,7 +238,7 @@ RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
} }
} }
template<class T> void template<class T> LIBPBD_API void
RingBufferNPT<T>::get_write_vector (RingBufferNPT<T>::rw_vector *vec) RingBufferNPT<T>::get_write_vector (RingBufferNPT<T>::rw_vector *vec)
{ {
size_t free_cnt; size_t free_cnt;

View file

@ -23,6 +23,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
/** /**
@ -36,7 +38,7 @@ namespace PBD {
* The SearchPath class does not test whether the paths exist * The SearchPath class does not test whether the paths exist
* or are directories. It is basically just a container. * or are directories. It is basically just a container.
*/ */
class SearchPath : public std::vector<std::string> class LIBPBD_API SearchPath : public std::vector<std::string>
{ {
public: public:
/** /**

View file

@ -28,14 +28,16 @@
#include <sys/types.h> #include <sys/types.h>
#include "pbd/libpbd_visibility.h"
namespace Select { namespace Select {
enum Condition { enum LIBPBD_API Condition {
Readable = 0x1, Readable = 0x1,
Writable = 0x2, Writable = 0x2,
Exception = 0x4 Exception = 0x4
}; };
class Selectable : public sigc::trackable class LIBPBD_API Selectable : public sigc::trackable
{ {
public: public:
@ -70,7 +72,7 @@ class Selectable : public sigc::trackable
std::string path; std::string path;
}; };
class Selector { class LIBPBD_API Selector {
private: private:
int post_select (fd_set *, fd_set *, fd_set *); int post_select (fd_set *, fd_set *, fd_set *);
int _max_fd; int _max_fd;

View file

@ -29,6 +29,7 @@
# include <errno.h> # include <errno.h>
#endif #endif
#include "pbd/libpbd_visibility.h"
#include "pbd/failed_constructor.h" #include "pbd/failed_constructor.h"
namespace PBD { namespace PBD {
@ -45,7 +46,7 @@ namespace PBD {
only safe way to reliably signal from a real-time audio thread. The only safe way to reliably signal from a real-time audio thread. The
counting semantics also complement ringbuffers of events nicely. counting semantics also complement ringbuffers of events nicely.
*/ */
class Semaphore class LIBPBD_API Semaphore
{ {
public: public:
/** /**

View file

@ -21,9 +21,11 @@
#include <semaphore.h> #include <semaphore.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class ProcessSemaphore { class LIBPBD_API ProcessSemaphore {
private: private:
#ifdef __APPLE__ #ifdef __APPLE__
sem_t* _sem; sem_t* _sem;

View file

@ -27,6 +27,7 @@
#include <boost/function.hpp> #include <boost/function.hpp>
#include "pbd/libpbd_visibility.h"
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/id.h" #include "pbd/id.h"
#include "pbd/property_basics.h" #include "pbd/property_basics.h"
@ -43,7 +44,7 @@ namespace PBD {
* any change. * any change.
*/ */
template<typename Container> template<typename Container>
class SequenceProperty : public PropertyBase class LIBPBD_API SequenceProperty : public PropertyBase
{ {
public: public:
typedef std::set<typename Container::value_type> ChangeContainer; typedef std::set<typename Container::value_type> ChangeContainer;

View file

@ -22,6 +22,8 @@
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
Glib::ustring short_path (const Glib::ustring& path, Glib::ustring::size_type target_characters); #include "pbd/libpbd_visibility.h"
LIBPBD_API Glib::ustring short_path (const Glib::ustring& path, Glib::ustring::size_type target_characters);
#endif /* __pbd_shortpath_h__ */ #endif /* __pbd_shortpath_h__ */

View file

@ -31,13 +31,14 @@
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "pbd/libpbd_visibility.h"
#include "pbd/event_loop.h" #include "pbd/event_loop.h"
namespace PBD { namespace PBD {
class Connection; class LIBPBD_API Connection;
class SignalBase class LIBPBD_API SignalBase
{ {
public: public:
virtual ~SignalBase () {} virtual ~SignalBase () {}
@ -47,7 +48,7 @@ protected:
Glib::Threads::Mutex _mutex; Glib::Threads::Mutex _mutex;
}; };
class Connection : public boost::enable_shared_from_this<Connection> class LIBPBD_API Connection : public boost::enable_shared_from_this<Connection>
{ {
public: public:
Connection (SignalBase* b) : _signal (b) {} Connection (SignalBase* b) : _signal (b) {}
@ -73,7 +74,7 @@ private:
}; };
template<typename R> template<typename R>
class OptionalLastValue class LIBPBD_API OptionalLastValue
{ {
public: public:
typedef boost::optional<R> result_type; typedef boost::optional<R> result_type;
@ -92,7 +93,7 @@ public:
typedef boost::shared_ptr<Connection> UnscopedConnection; typedef boost::shared_ptr<Connection> UnscopedConnection;
class ScopedConnection class LIBPBD_API ScopedConnection
{ {
public: public:
ScopedConnection () {} ScopedConnection () {}
@ -123,7 +124,7 @@ private:
UnscopedConnection _c; UnscopedConnection _c;
}; };
class ScopedConnectionList : public boost::noncopyable class LIBPBD_API ScopedConnectionList : public boost::noncopyable
{ {
public: public:
ScopedConnectionList(); ScopedConnectionList();

View file

@ -25,13 +25,15 @@
#include <map> #include <map>
#include <sndfile.h> #include <sndfile.h>
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "pbd/file_manager.h" #include "pbd/file_manager.h"
namespace PBD { namespace PBD {
/** FileDescriptor for a file to be opened using libsndfile */ /** FileDescriptor for a file to be opened using libsndfile */
class SndFileDescriptor : public FileDescriptor class LIBPBD_API SndFileDescriptor : public FileDescriptor
{ {
public: public:
SndFileDescriptor (std::string const & file_name, bool writeable, SF_INFO* info); SndFileDescriptor (std::string const & file_name, bool writeable, SF_INFO* info);

View file

@ -34,12 +34,15 @@
#include <cstdlib> #include <cstdlib>
#endif #endif
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
void stacktrace (std::ostream& out, int levels = 0); LIBPBD_API void stacktrace (std::ostream& out, int levels = 0);
void trace_twb(); LIBPBD_API void trace_twb();
template<typename T> template<typename T>
class thing_with_backtrace class LIBPBD_API thing_with_backtrace
{ {
public: public:
thing_with_backtrace () { thing_with_backtrace () {
@ -108,8 +111,8 @@ private:
static Glib::Threads::Mutex all_mutex; static Glib::Threads::Mutex all_mutex;
}; };
template<typename T> std::list<PBD::thing_with_backtrace<T> *> PBD::thing_with_backtrace<T>::all; template<typename T> LIBPBD_API std::list<PBD::thing_with_backtrace<T> *> PBD::thing_with_backtrace<T>::all;
template<typename T> Glib::Threads::Mutex PBD::thing_with_backtrace<T>::all_mutex; template<typename T> LIBPBD_API Glib::Threads::Mutex PBD::thing_with_backtrace<T>::all_mutex;
} // namespace PBD } // namespace PBD

View file

@ -24,6 +24,7 @@
#include <list> #include <list>
#include <cassert> #include <cassert>
#include "pbd/libpbd_visibility.h"
#include "pbd/id.h" #include "pbd/id.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/property_basics.h" #include "pbd/property_basics.h"
@ -34,14 +35,14 @@ class XMLNode;
namespace PBD { namespace PBD {
namespace sys { namespace sys {
class path; class LIBPBD_API path;
} }
class PropertyList; class LIBPBD_API PropertyList;
class OwnedPropertyList; class LIBPBD_API OwnedPropertyList;
/** Base class for objects with saveable and undoable state */ /** Base class for objects with saveable and undoable state */
class Stateful { class LIBPBD_API Stateful {
public: public:
Stateful (); Stateful ();
virtual ~Stateful(); virtual ~Stateful();

View file

@ -22,18 +22,20 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include "pbd/libpbd_visibility.h"
#include "pbd/command.h" #include "pbd/command.h"
namespace PBD namespace PBD
{ {
class StatefulDestructible; class LIBPBD_API StatefulDestructible;
class PropertyList; class LIBPBD_API PropertyList;
/** A Command which stores its action as the differences between the before and after /** A Command which stores its action as the differences between the before and after
* state of a Stateful object. * state of a Stateful object.
*/ */
class StatefulDiffCommand : public Command class LIBPBD_API StatefulDiffCommand : public Command
{ {
public: public:
StatefulDiffCommand (boost::shared_ptr<StatefulDestructible>); StatefulDiffCommand (boost::shared_ptr<StatefulDestructible>);

View file

@ -20,12 +20,13 @@
#ifndef __pbd_stateful_destructible_h__ #ifndef __pbd_stateful_destructible_h__
#define __pbd_stateful_destructible_h__ #define __pbd_stateful_destructible_h__
#include "pbd/libpbd_visibility.h"
#include "pbd/stateful.h" #include "pbd/stateful.h"
#include "pbd/destructible.h" #include "pbd/destructible.h"
namespace PBD { namespace PBD {
class StatefulDestructible : public Stateful, public Destructible class LIBPBD_API StatefulDestructible : public Stateful, public Destructible
{ {
}; };

View file

@ -20,12 +20,13 @@
#ifndef __libmisc_stl_delete_h__ #ifndef __libmisc_stl_delete_h__
#define __libmisc_stl_delete_h__ #define __libmisc_stl_delete_h__
#include "pbd/libpbd_visibility.h"
/* To actually use any of these deletion functions, you need to /* To actually use any of these deletion functions, you need to
first include the revelant container type header. first include the revelant container type header.
*/ */
#if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR) || defined(_LIBCPP_VECTOR) #if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR) || defined(_LIBCPP_VECTOR)
template<class T> void vector_delete (std::vector<T *> *vec) template<class T> LIBPBD_API void vector_delete (std::vector<T *> *vec)
{ {
typename std::vector<T *>::iterator i; typename std::vector<T *>::iterator i;
@ -37,7 +38,7 @@ template<class T> void vector_delete (std::vector<T *> *vec)
#endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR || _LIBCPP_VECTOR #endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR || _LIBCPP_VECTOR
#if defined(_CPP_MAP) || defined(_GLIBCXX_MAP) || defined(__SGI_STL_MAP) #if defined(_CPP_MAP) || defined(_GLIBCXX_MAP) || defined(__SGI_STL_MAP)
template<class K, class T> void map_delete (std::map<K, T *> *m) template<class K, class T> LIBPBD_API void map_delete (std::map<K, T *> *m)
{ {
typename std::map<K, T *>::iterator i; typename std::map<K, T *>::iterator i;
@ -49,7 +50,7 @@ template<class K, class T> void map_delete (std::map<K, T *> *m)
#endif // _CPP_MAP || _GLIBCXX_MAP || __SGI_STL_MAP #endif // _CPP_MAP || _GLIBCXX_MAP || __SGI_STL_MAP
#if defined(_CPP_LIST) || defined(_GLIBCXX_LIST) || defined(__SGI_STL_LIST) #if defined(_CPP_LIST) || defined(_GLIBCXX_LIST) || defined(__SGI_STL_LIST)
template<class T> void list_delete (std::list<T *> *l) template<class T> LIBPBD_API void list_delete (std::list<T *> *l)
{ {
typename std::list<T *>::iterator i; typename std::list<T *>::iterator i;
@ -62,7 +63,7 @@ template<class T> void list_delete (std::list<T *> *l)
#endif // _CPP_LIST || _GLIBCXX_LIST || __SGI_STL_LIST #endif // _CPP_LIST || _GLIBCXX_LIST || __SGI_STL_LIST
#if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST) #if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST)
template<class T> void slist_delete (std::slist<T *> *l) template<class T> LIBPBD_API void slist_delete (std::slist<T *> *l)
{ {
typename std::slist<T *>::iterator i; typename std::slist<T *>::iterator i;
@ -75,7 +76,7 @@ template<class T> void slist_delete (std::slist<T *> *l)
#endif // _CPP_SLIST || _GLIBCXX_SLIST || __SGI_STL_SLIST #endif // _CPP_SLIST || _GLIBCXX_SLIST || __SGI_STL_SLIST
#if defined(_CPP_SET) || defined(_GLIBCXX_SET) || defined(__SGI_STL_SET) #if defined(_CPP_SET) || defined(_GLIBCXX_SET) || defined(__SGI_STL_SET)
template<class T> void set_delete (std::set<T *> *sset) template<class T> void LIBPBD_API set_delete (std::set<T *> *sset)
{ {
typename std::set<T *>::iterator i; typename std::set<T *>::iterator i;

View file

@ -22,8 +22,10 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
#ifndef LESS_STRING_P #ifndef LESS_STRING_P
struct less<std::string *> { struct LIBPBD_API less<std::string *> {
bool operator()(std::string *s1, std::string *s2) const { bool operator()(std::string *s1, std::string *s2) const {
return *s1 < *s2; return *s1 < *s2;
} }
@ -32,7 +34,7 @@ struct less<std::string *> {
#endif // LESS_STRING_P #endif // LESS_STRING_P
#ifndef LESS_CONST_STRING_P #ifndef LESS_CONST_STRING_P
struct less<const std::string *> { struct LIBPBD_API less<const std::string *> {
bool operator()(const std::string *s1, const std::string *s2) const { bool operator()(const std::string *s1, const std::string *s2) const {
return *s1 < *s2; return *s1 < *s2;
} }
@ -41,7 +43,7 @@ struct less<const std::string *> {
#endif // LESS_CONST_STRING_P #endif // LESS_CONST_STRING_P
#ifndef LESS_CONST_CHAR_P #ifndef LESS_CONST_CHAR_P
struct less<const char *> struct LIBPBD_API less<const char *>
{ {
bool operator()(const char* s1, const char* s2) const { bool operator()(const char* s1, const char* s2) const {
return strcmp(s1, s2) < 0; return strcmp(s1, s2) < 0;
@ -51,7 +53,7 @@ struct less<const char *>
#endif // LESS_CONST_CHAR_P #endif // LESS_CONST_CHAR_P
#ifndef LESS_CONST_FLOAT_P #ifndef LESS_CONST_FLOAT_P
struct less<const float *> struct LIBPBD_API less<const float *>
{ {
bool operator()(const float *n1, const float *n2) const { bool operator()(const float *n1, const float *n2) const {
return *n1 < *n2; return *n1 < *n2;
@ -61,7 +63,7 @@ struct less<const float *>
#endif // LESS_CONST_FLOAT_P #endif // LESS_CONST_FLOAT_P
#ifndef EQUAL_TO_CONST_CHAR_P #ifndef EQUAL_TO_CONST_CHAR_P
struct equal_to<const char *> struct LIBPBD_API equal_to<const char *>
{ {
bool operator()(const char *s1, const char *s2) const { bool operator()(const char *s1, const char *s2) const {
return strcmp (s1, s2) == 0; return strcmp (s1, s2) == 0;
@ -71,7 +73,7 @@ struct equal_to<const char *>
#endif // EQUAL_TO_CONST_CHAR_P #endif // EQUAL_TO_CONST_CHAR_P
#ifndef EQUAL_TO_STRING_P #ifndef EQUAL_TO_STRING_P
struct equal_to<std::string *> struct LIBPBD_API equal_to<std::string *>
{ {
bool operator()(const std::string *s1, const std::string *s2) const { bool operator()(const std::string *s1, const std::string *s2) const {
return *s1 == *s2; return *s1 == *s2;
@ -81,7 +83,7 @@ struct equal_to<std::string *>
#endif // EQUAL_TO_STRING_P #endif // EQUAL_TO_STRING_P
#ifndef LESS_CONST_STRING_R #ifndef LESS_CONST_STRING_R
struct less<const std::string &> { struct LIBPBD_API less<const std::string &> {
bool operator() (const std::string &s1, const std::string &s2) { bool operator() (const std::string &s1, const std::string &s2) {
return s1 < s2; return s1 < s2;
} }

View file

@ -24,7 +24,9 @@
#include <vector> #include <vector>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
extern void split (std::string, std::vector<std::string>&, char); #include "pbd/libpbd_visibility.h"
extern void split (Glib::ustring, std::vector<Glib::ustring>&, char);
LIBPBD_API extern void split (std::string, std::vector<std::string>&, char);
LIBPBD_API extern void split (Glib::ustring, std::vector<Glib::ustring>&, char);
#endif // __pbd_strplit_h__ #endif // __pbd_strplit_h__

View file

@ -22,9 +22,10 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
#include "receiver.h" #include "receiver.h"
class TextReceiver : public Receiver class LIBPBD_API TextReceiver : public Receiver
{ {
public: public:
TextReceiver (const std::string &n); TextReceiver (const std::string &n);

View file

@ -19,6 +19,7 @@
#ifndef __qm_thrown_error_h__ #ifndef __qm_thrown_error_h__
#define __qm_thrown_error_h__ #define __qm_thrown_error_h__
#include "pbd/libpbd_visibility.h"
#include "transmitter.h" #include "transmitter.h"
#define SAFE_THROW(T) \ #define SAFE_THROW(T) \
@ -26,7 +27,7 @@
(*sent) << rdbuf(); \ (*sent) << rdbuf(); \
throw sent throw sent
class ThrownError : public Transmitter { class LIBPBD_API ThrownError : public Transmitter {
public: public:
ThrownError () : Transmitter (Transmitter::Throw) {} ThrownError () : Transmitter (Transmitter::Throw) {}
protected: protected:

View file

@ -23,6 +23,7 @@
#include <iterator> #include <iterator>
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
#include "pbd/whitespace.h" #include "pbd/whitespace.h"
namespace PBD { namespace PBD {
@ -36,7 +37,7 @@ namespace PBD {
are discarded. are discarded.
*/ */
template<typename StringType, typename Iter> template<typename StringType, typename Iter>
unsigned int LIBPBD_API unsigned int
tokenize(const StringType& str, tokenize(const StringType& str,
const StringType& delims, const StringType& delims,
Iter it, Iter it,

View file

@ -19,7 +19,9 @@
#ifndef __pbd_touchable_h__ #ifndef __pbd_touchable_h__
#define __pbd_touchable_h__ #define __pbd_touchable_h__
class Touchable #include "pbd/libpbd_visibility.h"
class LIBPBD_API Touchable
{ {
public: public:
Touchable() : _delete_after_touch (false) {} Touchable() : _delete_after_touch (false) {}
@ -35,7 +37,7 @@ class Touchable
}; };
template<class T> template<class T>
class DynamicTouchable : public Touchable class LIBPBD_API DynamicTouchable : public Touchable
{ {
public: public:
DynamicTouchable (T& t, void (T::*m)(void)) DynamicTouchable (T& t, void (T::*m)(void))
@ -51,7 +53,7 @@ class DynamicTouchable : public Touchable
}; };
template<class T1, class T2> template<class T1, class T2>
class DynamicTouchable1 : public Touchable class LIBPBD_API DynamicTouchable1 : public Touchable
{ {
public: public:
DynamicTouchable1 (T1& t, void (T1::*m)(T2), T2 a) DynamicTouchable1 (T1& t, void (T1::*m)(T2), T2 a)
@ -68,7 +70,7 @@ class DynamicTouchable1 : public Touchable
}; };
template<class T1, class T2, class T3> template<class T1, class T2, class T3>
class DynamicTouchable2 : public Touchable class LIBPBD_API DynamicTouchable2 : public Touchable
{ {
public: public:
DynamicTouchable2 (T1& t, void (T1::*m)(T2, T3), T2 a1, T3 a2) DynamicTouchable2 (T1& t, void (T1::*m)(T2, T3), T2 a1, T3 a2)

View file

@ -25,7 +25,9 @@
#include <sigc++/sigc++.h> #include <sigc++/sigc++.h>
class Transmitter : public std::stringstream #include "pbd/libpbd_visibility.h"
class LIBPBD_API Transmitter : public std::stringstream
{ {
public: public:
@ -100,6 +102,6 @@ endmsg (std::ostream &ostr)
} }
extern "C" { void pbd_c_error (const char *); } extern "C" { LIBPBD_API void pbd_c_error (const char *); }
#endif // __libmisc_transmitter_h__ #endif // __libmisc_transmitter_h__

View file

@ -27,11 +27,12 @@
#include <sigc++/bind.h> #include <sigc++/bind.h>
#include <sys/time.h> #include <sys/time.h>
#include "pbd/libpbd_visibility.h"
#include "pbd/command.h" #include "pbd/command.h"
typedef sigc::slot<void> UndoAction; typedef sigc::slot<void> UndoAction;
class UndoTransaction : public Command class LIBPBD_API UndoTransaction : public Command
{ {
public: public:
UndoTransaction (); UndoTransaction ();
@ -70,7 +71,7 @@ class UndoTransaction : public Command
void about_to_explicitly_delete (); void about_to_explicitly_delete ();
}; };
class UndoHistory : public PBD::ScopedConnectionList class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList
{ {
public: public:
UndoHistory(); UndoHistory();

View file

@ -22,7 +22,9 @@
#include <exception> #include <exception>
class unknown_type : public std::exception { #include "pbd/libpbd_visibility.h"
class LIBPBD_API unknown_type : public std::exception {
public: public:
virtual const char *what() const throw() { return "unknown type"; } virtual const char *what() const throw() { return "unknown type"; }
}; };

View file

@ -20,10 +20,12 @@
#ifndef __libpbd_unwinder_h__ #ifndef __libpbd_unwinder_h__
#define __libpbd_unwinder_h__ #define __libpbd_unwinder_h__
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
template <typename T> template <typename T>
class Unwinder { class LIBPBD_API Unwinder {
public: public:
Unwinder (T& var, T new_val) : _var (var), _old_val (var) { var = new_val; } Unwinder (T& var, T new_val) : _var (var), _old_val (var) { var = new_val; }
~Unwinder () { _var = _old_val; } ~Unwinder () { _var = _old_val; }

View file

@ -24,9 +24,11 @@
#include <string> #include <string>
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class UUID { class LIBPBD_API UUID {
public: public:
UUID () { uuid_generate (id); } UUID () { uuid_generate (id); }

View file

@ -25,9 +25,11 @@
#include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp> #include <boost/uuid/uuid_generators.hpp>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
class UUID : public boost::uuids::uuid { class LIBPBD_API UUID : public boost::uuids::uuid {
public: public:
UUID () UUID ()

View file

@ -22,11 +22,13 @@
#include <string> #include <string>
#include "pbd/libpbd_visibility.h"
namespace PBD { namespace PBD {
// returns the empty string if the entire string is whitespace // returns the empty string if the entire string is whitespace
// so check length after calling. // so check length after calling.
extern void strip_whitespace_edges (std::string& str); LIBPBD_API extern void strip_whitespace_edges (std::string& str);
} // namespace PBD } // namespace PBD

View file

@ -17,6 +17,9 @@
*/ */
#ifndef __XML_H
#define __XML_H
/* xml++.h /* xml++.h
* libxml++ and this file are copyright (C) 2000 by Ari Johnson, and * libxml++ and this file are copyright (C) 2000 by Ari Johnson, and
* are covered by the GNU Lesser General Public License, which should be * are covered by the GNU Lesser General Public License, which should be
@ -34,8 +37,7 @@
#include <libxml/tree.h> #include <libxml/tree.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#ifndef __XML_H #include "pbd/libpbd_visibility.h"
#define __XML_H
class XMLTree; class XMLTree;
class XMLNode; class XMLNode;
@ -50,7 +52,7 @@ typedef XMLPropertyList::iterator XMLPropertyIterator;
typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; typedef XMLPropertyList::const_iterator XMLPropertyConstIterator;
typedef std::map<std::string, XMLProperty*> XMLPropertyMap; typedef std::map<std::string, XMLProperty*> XMLPropertyMap;
class XMLTree { class LIBPBD_API XMLTree {
public: public:
XMLTree(); XMLTree();
XMLTree(const std::string& fn, bool validate = false); XMLTree(const std::string& fn, bool validate = false);
@ -90,7 +92,7 @@ private:
int _compression; int _compression;
}; };
class XMLNode { class LIBPBD_API XMLNode {
public: public:
XMLNode(const std::string& name); XMLNode(const std::string& name);
XMLNode(const std::string& name, const std::string& content); XMLNode(const std::string& name, const std::string& content);
@ -148,7 +150,7 @@ private:
void clear_lists (); void clear_lists ();
}; };
class XMLProperty { class LIBPBD_API XMLProperty {
public: public:
XMLProperty(const std::string& n, const std::string& v = std::string()); XMLProperty(const std::string& n, const std::string& v = std::string());
~XMLProperty(); ~XMLProperty();
@ -162,7 +164,7 @@ private:
std::string _value; std::string _value;
}; };
class XMLException: public std::exception { class LIBPBD_API XMLException: public std::exception {
public: public:
explicit XMLException(const std::string msg) : _message(msg) {} explicit XMLException(const std::string msg) : _message(msg) {}
virtual ~XMLException() throw() {} virtual ~XMLException() throw() {}

View file

@ -114,10 +114,15 @@ def build(bld):
if bld.is_defined ('INTERNAL_SHARED_LIBS'): if bld.is_defined ('INTERNAL_SHARED_LIBS'):
print('BUILD SHARED LIB') print('BUILD SHARED LIB')
obj = bld.shlib(features = 'cxx cxxshlib', source=libpbd_sources) obj = bld.shlib(features = 'cxx cxxshlib', source=libpbd_sources)
obj.defines = [ 'LIBPBD_DLL=1',
'LIBPBD_DLL_EXPORTS=1'
]
else: else:
print('BUILD STATIC LIB') print('BUILD STATIC LIB')
obj = bld.stlib(features = 'cxx cxxstlib', source=libpbd_sources) obj = bld.stlib(features = 'cxx cxxstlib', source=libpbd_sources)
obj.cxxflags = [ '-fPIC' ] obj.cxxflags = [ '-fPIC' ]
obj.defines = []
if bld.is_defined('DEBUG_RT_ALLOC'): if bld.is_defined('DEBUG_RT_ALLOC'):
obj.source += 'debug_rt_alloc.c' obj.source += 'debug_rt_alloc.c'
@ -134,7 +139,7 @@ def build(bld):
obj.uselib += ' OSX' obj.uselib += ' OSX'
obj.vnum = LIBPBD_LIB_VERSION obj.vnum = LIBPBD_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.defines = ['PACKAGE="' + I18N_PACKAGE + '"'] obj.defines += [ 'PACKAGE="' + I18N_PACKAGE + '"' ]
if bld.env['build_target'] == 'x86_64': if bld.env['build_target'] == 'x86_64':
obj.defines += [ 'USE_X86_64_ASM' ] obj.defines += [ 'USE_X86_64_ASM' ]