Use LIBPBD_TEMPLATE_API and LIBPBD_TEMPLATE_MEMBER_API where appropriate
authorJohn Emmas <johne53@tiscali.co.uk>
Sat, 8 Mar 2014 11:28:54 +0000 (11:28 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Sat, 8 Mar 2014 11:28:54 +0000 (11:28 +0000)
libs/pbd/pbd/libpbd_visibility.h
libs/pbd/pbd/property_basics.h
libs/pbd/pbd/search_path.h

index e5e0ba22bd49cb3aa290a622c476519494cebf7a..f77eeb15ed64ad3d543d9e300ce8029598f550fd 100644 (file)
   #define LIBPBD_DLL_LOCAL
   #define LIBPBD_TEMPLATE_DLL_IMPORT
   #define LIBPBD_TEMPLATE_DLL_EXPORT
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT __declspec(dllimport)
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT __declspec(dllexport)
 #else
   #define LIBPBD_DLL_IMPORT __attribute__ ((visibility ("default")))
   #define LIBPBD_DLL_EXPORT __attribute__ ((visibility ("default")))
   #define LIBPBD_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
   #define LIBPBD_TEMPLATE_DLL_IMPORT __attribute__ ((visibility ("default")))
   #define LIBPBD_TEMPLATE_DLL_EXPORT __attribute__ ((visibility ("default")))
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT
 #endif
 
 #ifdef LIBPBD_STATIC // libpbd is a DLL
   #define LIBPBD_API
   #define LIBPBD_LOCAL
+  #define LIBPBD_TEMPLATE_API
+  #define LIBPBD_TEMPLATE_MEMBER_API
 #else
   #ifdef LIBPBD_DLL_EXPORTS // defined if we are building the libpbd DLL (instead of using it)
     #define LIBPBD_API LIBPBD_DLL_EXPORT
     #define LIBPBD_TEMPLATE_API LIBPBD_TEMPLATE_DLL_EXPORT
+    #define LIBPBD_TEMPLATE_MEMBER_API LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT
   #else
     #define LIBPBD_API LIBPBD_DLL_IMPORT
     #define LIBPBD_TEMPLATE_API LIBPBD_TEMPLATE_DLL_IMPORT
+    #define LIBPBD_TEMPLATE_MEMBER_API LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT
   #endif 
   #define LIBPBD_LOCAL LIBPBD_DLL_LOCAL
 #endif
index a6af84e2e74694cfb88c1d72d731ba7b390189d1..c4e4549ecd7486ad105413ba1fae1d0ac6f0220e 100644 (file)
@@ -38,7 +38,7 @@ class LIBPBD_API StatefulDiffCommand;
 typedef GQuark PropertyID;
 
 template<typename T>
-struct LIBPBD_API PropertyDescriptor {
+struct LIBPBD_TEMPLATE_API PropertyDescriptor {
        PropertyDescriptor () : property_id (0) {}
        PropertyDescriptor (PropertyID pid) : property_id (pid) {}
        
@@ -47,17 +47,17 @@ struct LIBPBD_API PropertyDescriptor {
 };
 
 /** A list of IDs of Properties that have changed in some situation or other */
-class LIBPBD_API PropertyChange : public std::set<PropertyID>
+class LIBPBD_TEMPLATE_API PropertyChange : public std::set<PropertyID>
 {
 public:
-       PropertyChange() {}
-       ~PropertyChange() {}
+       LIBPBD_TEMPLATE_MEMBER_API PropertyChange() {}
+       LIBPBD_TEMPLATE_MEMBER_API ~PropertyChange() {}
 
        template<typename T> PropertyChange(PropertyDescriptor<T> p);
 
-       PropertyChange(const PropertyChange& other) : std::set<PropertyID> (other) {}
+       LIBPBD_TEMPLATE_MEMBER_API PropertyChange(const PropertyChange& other) : std::set<PropertyID> (other) {}
 
-       PropertyChange operator=(const PropertyChange& other) {
+       LIBPBD_TEMPLATE_MEMBER_API PropertyChange operator=(const PropertyChange& other) {
                clear ();
                insert (other.begin (), other.end ());
                return *this;
@@ -66,7 +66,7 @@ public:
        template<typename T> PropertyChange operator=(PropertyDescriptor<T> p);
        template<typename T> bool contains (PropertyDescriptor<T> p) const;
 
-       bool contains (const PropertyChange& other) const {
+       LIBPBD_TEMPLATE_MEMBER_API bool contains (const PropertyChange& other) const {
                for (const_iterator x = other.begin (); x != other.end (); ++x) {
                        if (find (*x) != end ()) {
                                return true;
index f6ff347ec31670e01332f51b6a606928d0dce540..2ccd9bf0eeab9e32c7fb1e0871152b4277ab5acc 100644 (file)
@@ -38,13 +38,13 @@ namespace PBD {
  * The Searchpath class does not test whether the paths exist
  * or are directories. It is basically just a container.
  */
-class LIBPBD_API Searchpath : public std::vector<std::string>
+class LIBPBD_TEMPLATE_API Searchpath : public std::vector<std::string>
 {
 public:
        /**
         * Create an empty Searchpath.
         */
-       Searchpath ();
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath ();
 
        /**
         * Initialize Searchpath from a string where the string contains
@@ -57,7 +57,7 @@ public:
         * 
         * @param search_path A path string.
         */
-       Searchpath (const std::string& search_path);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string& search_path);
 
        /**
         * Initialize Searchpath from a vector of paths that may or may
@@ -65,9 +65,9 @@ public:
         *
         * @param paths A vector of paths.
         */
-       Searchpath (const std::vector<std::string>& paths);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::vector<std::string>& paths);
 
-       ~Searchpath () {};
+       LIBPBD_TEMPLATE_MEMBER_API ~Searchpath () {};
 
        /**
         * @return a search path string.
@@ -75,39 +75,39 @@ public:
         * The string that is returned contains the platform specific
         * path separator.
         */
-       const std::string to_string () const;
+       LIBPBD_TEMPLATE_MEMBER_API const std::string to_string () const;
 
        /**
         * Add all the directories in path to this.
         */
-       Searchpath& operator+= (const Searchpath& spath);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const Searchpath& spath);
 
        /**
         * Add another directory path to the search path.
         */
-       Searchpath& operator+= (const std::string& directory_path);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path);
        
        /**
         * Concatenate another Searchpath onto this.
         */
-       Searchpath& operator+ (const Searchpath& other);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+ (const Searchpath& other);
        
        /**
         * Add another path to the search path.
         */
-       Searchpath& operator+ (const std::string& directory_path);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+ (const std::string& directory_path);
 
        /**
         * Add a sub-directory to each path in the search path.
         * @param subdir The directory name, it should not contain 
         * any path separating tokens.
         */
-       Searchpath& add_subdirectory_to_paths (const std::string& subdir);
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& add_subdirectory_to_paths (const std::string& subdir);
 
 protected:
 
-       void add_directory (const std::string& directory_path);
-       void add_directories (const std::vector<std::string>& paths);
+       LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string& directory_path);
+       LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector<std::string>& paths);
 };
 
 void export_search_path (const std::string& base_dir, const char* varname, const char* dir);