ソースを参照

Correctly set export directives on non-Windows platforms.

This was nasty. On gcc with -fvisiblity=hidden, symbols marked to be
exported had "default" visibility in the shared object where they are
declared, but "hidden" visibility in shared objects where they are used.
For symbols with vague linkage (all RTTI symbols and others), only one
occurrence of the same symbol with "hidden" visibility causes the symbol
to vanish in the outputted binary.

The fixed define statements are now actually the same as they are in
Qt itself.

See http://gcc.gnu.org/wiki/Visibility
Sascha Zelzer 14 年 前
コミット
9d40144ec9
共有1 個のファイルを変更した14 個の追加4 個の削除を含む
  1. 14 4
      Libs/ctkExport.h.in

+ 14 - 4
Libs/ctkExport.h.in

@@ -10,10 +10,20 @@
 
 #include <QtCore/qglobal.h>
 
-#if defined(@MY_LIBNAME@_EXPORTS)
- #define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_EXPORT
-#else
- #define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_IMPORT
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#  if defined(@MY_LIBNAME@_EXPORTS)
+#    define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_EXPORT
+#  else
+#    define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_IMPORT
+#  endif
+#endif
+
+#if !defined(@MY_LIBRARY_EXPORT_DIRECTIVE@)
+//#  if defined(CTK_SHARED)
+#    define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_EXPORT
+//#  else
+//#    define @MY_LIBRARY_EXPORT_DIRECTIVE@
+//#  endif
 #endif
 
 #endif