Last-Update: 2009-12-02
Author: Rene Engelhard <rene@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559219
Description: add __attribute__((visibility("default"))) to the exceptions

--- a/cppconn/exception.h
+++ b/cppconn/exception.h
@@ -31,8 +31,10 @@
 #include <stdexcept>
 #include <string>
 #include <memory>
 
+#define CPPCONN_PUBLIC_EXCEPTION __attribute__((visibility("default")))
+
 namespace sql
 {
 
 #define MEMORY_ALLOC_OPERATORS(Class) \
@@ -51,9 +53,9 @@
 
 #pragma warning(push)
 #pragma warning(disable: 4275)
 #endif
-class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error
+class CPPCONN_PUBLIC_EXCEPTION SQLException : public std::runtime_error
 {
 #ifdef _WIN32
 #pragma warning(pop)
 #endif
@@ -97,28 +99,28 @@
 protected:
 	MEMORY_ALLOC_OPERATORS(SQLException)
 };
 
-struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException
+struct CPPCONN_PUBLIC_EXCEPTION MethodNotImplementedException : public SQLException
 {
 	MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
 	MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {}
 };
 
-struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException
+struct CPPCONN_PUBLIC_EXCEPTION InvalidArgumentException : public SQLException
 {
 	InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
 	InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {}
 };
 
-struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException
+struct CPPCONN_PUBLIC_EXCEPTION InvalidInstanceException : public SQLException
 {
 	InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
 	InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {}
 };
 
 
-struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException
+struct CPPCONN_PUBLIC_EXCEPTION NonScrollableException : public SQLException
 {
 	NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
 	NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {}
 };
