diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | abstractmetabuilder.h | 2 | ||||
-rw-r--r-- | abstractmetalang.h | 18 | ||||
-rw-r--r-- | apiextractor.h | 3 | ||||
-rw-r--r-- | apiextractormacros.h | 20 | ||||
-rw-r--r-- | docparser.h | 3 | ||||
-rw-r--r-- | fileout.h | 3 | ||||
-rw-r--r-- | qtdocparser.h | 2 | ||||
-rw-r--r-- | reporthandler.h | 3 | ||||
-rw-r--r-- | typesystem.h | 19 |
10 files changed, 49 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 08eee62e9..db08bf512 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(Qt4 4.5.0 REQUIRED) find_package(LibXml2 2.6.32 REQUIRED) find_package(LibXslt 1.1.19 REQUIRED) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -DAPIEXTRACTOR_ENABLE_DUPLICATE_ENUM_VALUES") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -DAPIEXTRACTOR_ENABLE_DUPLICATE_ENUM_VALUES -DAPIEXTRACTOR_BUILD -fvisibility=hidden") set(apiextractor_MAJOR_VERSION 0) set(apiextractor_MINOR_VERSION 3) @@ -92,6 +92,7 @@ add_custom_target(dist WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) set(root_HEADERS +apiextractormacros.h abstractmetalang.h apiextractor.h reporthandler.h diff --git a/abstractmetabuilder.h b/abstractmetabuilder.h index 18ee74365..ca4593e1e 100644 --- a/abstractmetabuilder.h +++ b/abstractmetabuilder.h @@ -31,7 +31,7 @@ #include <QtCore/QSet> -class AbstractMetaBuilder +class APIEXTRACTOR_API AbstractMetaBuilder { public: enum RejectReason { diff --git a/abstractmetalang.h b/abstractmetalang.h index 5ea94642d..cafe39bf9 100644 --- a/abstractmetalang.h +++ b/abstractmetalang.h @@ -42,7 +42,7 @@ class AbstractMetaEnumValue; class AbstractMetaEnum; class QPropertySpec; -class Documentation +class APIEXTRACTOR_API Documentation { public: enum Format { @@ -80,7 +80,7 @@ private: typedef QList<AbstractMetaField *> AbstractMetaFieldList; typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList; typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList; -class AbstractMetaClassList : public QList<AbstractMetaClass *> +class APIEXTRACTOR_API AbstractMetaClassList : public QList<AbstractMetaClass *> { public: AbstractMetaClass *findClass(const QString &name) const; @@ -89,9 +89,7 @@ public: }; - - -class AbstractMetaAttributes +class APIEXTRACTOR_API AbstractMetaAttributes { public: AbstractMetaAttributes() : m_attributes(0) {}; @@ -305,7 +303,7 @@ private: }; -class AbstractMetaType +class APIEXTRACTOR_API AbstractMetaType { public: enum TypeUsagePattern { @@ -610,7 +608,7 @@ private: uint m_reserved : 25; // unused }; -class AbstractMetaVariable +class APIEXTRACTOR_API AbstractMetaVariable { public: AbstractMetaVariable() : m_type(0) {} @@ -651,7 +649,7 @@ private: -class AbstractMetaArgument : public AbstractMetaVariable +class APIEXTRACTOR_API AbstractMetaArgument : public AbstractMetaVariable { public: AbstractMetaArgument() : m_argumentIndex(0) {}; @@ -736,7 +734,7 @@ private: }; -class AbstractMetaFunction : public AbstractMetaAttributes +class APIEXTRACTOR_API AbstractMetaFunction : public AbstractMetaAttributes { public: enum FunctionType { @@ -1255,7 +1253,7 @@ private: typedef QList<AbstractMetaEnum *> AbstractMetaEnumList; -class AbstractMetaClass : public AbstractMetaAttributes +class APIEXTRACTOR_API AbstractMetaClass : public AbstractMetaAttributes { public: enum FunctionQueryOption { diff --git a/apiextractor.h b/apiextractor.h index b745a91c0..1c729cf6f 100644 --- a/apiextractor.h +++ b/apiextractor.h @@ -26,12 +26,13 @@ #include "reporthandler.h" #include "abstractmetalang.h" +#include "apiextractormacros.h" #include <QStringList> class AbstractMetaBuilder; class QIODevice; -class ApiExtractor +class APIEXTRACTOR_API ApiExtractor { public: ApiExtractor(); diff --git a/apiextractormacros.h b/apiextractormacros.h new file mode 100644 index 000000000..b2cb4b0a6 --- /dev/null +++ b/apiextractormacros.h @@ -0,0 +1,20 @@ +#ifndef APIEXTRACTORMACROS_H +#define APIEXTRACTORMACROS_H + + +// APIEXTRACTOR_API is used for the public API symbols. +#if defined _WIN32 || defined __CYGWIN__ + #if APIEXTRACTOR_BUILD + #define APIEXTRACTOR_API __declspec(dllimport) + #else + #define APIEXTRACTOR_API __declspec(dllexport) + #endif +#else + #if __GNUC__ >= 4 + #define APIEXTRACTOR_API __attribute__ ((visibility("default"))) + #else + #define APIEXTRACTOR_API + #endif +#endif + +#endif diff --git a/docparser.h b/docparser.h index ecc3204e9..ab5dc9fa3 100644 --- a/docparser.h +++ b/docparser.h @@ -25,7 +25,6 @@ #include <QString> #include <QDir> -// #include <QtCore/QMap> #include "abstractmetalang.h" @@ -33,7 +32,7 @@ class QDomDocument; class QDomNode; class QXmlQuery; -class DocParser +class APIEXTRACTOR_API DocParser { public: DocParser(); @@ -27,8 +27,9 @@ #include <QtCore/QObject> #include <QtCore/QFile> #include <QtCore/QTextStream> +#include "apiextractormacros.h" -class FileOut : public QObject +class APIEXTRACTOR_API FileOut : public QObject { private: QByteArray tmp; diff --git a/qtdocparser.h b/qtdocparser.h index e4b7089d7..e2115f991 100644 --- a/qtdocparser.h +++ b/qtdocparser.h @@ -26,7 +26,7 @@ #include "docparser.h" -class QtDocParser : public DocParser +class APIEXTRACTOR_API QtDocParser : public DocParser { public: QtDocParser() {} diff --git a/reporthandler.h b/reporthandler.h index e13d3562f..1f70046ce 100644 --- a/reporthandler.h +++ b/reporthandler.h @@ -27,6 +27,7 @@ #include <QtCore/QString> #include <QtCore/QSet> #include <cstring> +#include "apiextractormacros.h" class ProgressAnimation { @@ -75,7 +76,7 @@ private: } }; -class ReportHandler +class APIEXTRACTOR_API ReportHandler { public: enum DebugLevel { NoDebug, SparseDebug, MediumDebug, FullDebug }; diff --git a/typesystem.h b/typesystem.h index 589196208..dc8344f6e 100644 --- a/typesystem.h +++ b/typesystem.h @@ -29,6 +29,7 @@ #include <QtCore/QStringList> #include <QtCore/QMap> #include <QtCore/QDebug> +#include "apiextractormacros.h" class Indentor; @@ -46,7 +47,7 @@ extern QString stringsJavaLang; extern QString strings_jchar; extern QString strings_jobject; -struct Include +struct APIEXTRACTOR_API Include { enum IncludeType { IncludePath, @@ -144,7 +145,7 @@ struct ArgumentOwner int index; }; -class CodeSnipFragment +class APIEXTRACTOR_API CodeSnipFragment { private: const QString m_code; @@ -161,7 +162,7 @@ public: QString code() const; }; -class CodeSnipAbstract +class APIEXTRACTOR_API CodeSnipAbstract { public: QString code() const; @@ -231,7 +232,7 @@ private: }; -class CodeSnip : public CodeSnipAbstract +class APIEXTRACTOR_API CodeSnip : public CodeSnipAbstract { public: enum Position { @@ -449,7 +450,7 @@ typedef QList<FieldModification> FieldModificationList; * This info will be used later to create a fake AbstractMetaFunction which * will be inserted into the right AbstractMetaClass. */ -struct AddedFunction +struct APIEXTRACTOR_API AddedFunction { /// Function access types. enum Access { @@ -582,7 +583,7 @@ private: typedef QList<DocModification> DocModificationList; -class TypeEntry +class APIEXTRACTOR_API TypeEntry { public: enum Type { @@ -1010,7 +1011,7 @@ private: }; -class PrimitiveTypeEntry : public TypeEntry +class APIEXTRACTOR_API PrimitiveTypeEntry : public TypeEntry { public: PrimitiveTypeEntry(const QString &name) @@ -1316,7 +1317,7 @@ private: }; -class ComplexTypeEntry : public TypeEntry +class APIEXTRACTOR_API ComplexTypeEntry : public TypeEntry { public: enum TypeFlag { @@ -1842,7 +1843,7 @@ struct TypeRejection QString enum_name; }; -class TypeDatabase +class APIEXTRACTOR_API TypeDatabase { TypeDatabase(); TypeDatabase(const TypeDatabase&); |