From: Konrad Rosenbaum Date: Wed, 25 Jul 2012 20:19:42 +0000 (+0200) Subject: make it shared, properly export symbols X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=533122de7a6e48191f7785fc2d167125eeb342dd;p=web%2Fkonrad%2Felam.git make it shared, properly export symbols --- diff --git a/include/AnyType b/include/AnyType new file mode 100644 index 0000000..5fcdb6e --- /dev/null +++ b/include/AnyType @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamvalue.h" diff --git a/include/BinaryOperator b/include/BinaryOperator new file mode 100644 index 0000000..9105013 --- /dev/null +++ b/include/BinaryOperator @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elambinary.h" diff --git a/include/BoolEngine b/include/BoolEngine new file mode 100644 index 0000000..cc9401d --- /dev/null +++ b/include/BoolEngine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamboolengine.h" diff --git a/include/CharacterClassSettings b/include/CharacterClassSettings new file mode 100644 index 0000000..4d4b633 --- /dev/null +++ b/include/CharacterClassSettings @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamcharclass.h" diff --git a/include/Engine b/include/Engine new file mode 100644 index 0000000..bea5477 --- /dev/null +++ b/include/Engine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamengine.h" diff --git a/include/Exception b/include/Exception new file mode 100644 index 0000000..5fcdb6e --- /dev/null +++ b/include/Exception @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamvalue.h" diff --git a/include/Expression b/include/Expression new file mode 100644 index 0000000..c46a659 --- /dev/null +++ b/include/Expression @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamexpression.h" diff --git a/include/FloatEngine b/include/FloatEngine new file mode 100644 index 0000000..0e25e64 --- /dev/null +++ b/include/FloatEngine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamfloatengine.h" diff --git a/include/IntEngine b/include/IntEngine new file mode 100644 index 0000000..147f580 --- /dev/null +++ b/include/IntEngine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamintengine.h" diff --git a/include/IntFloatEngine b/include/IntFloatEngine new file mode 100644 index 0000000..0e25e64 --- /dev/null +++ b/include/IntFloatEngine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamfloatengine.h" diff --git a/include/Position b/include/Position new file mode 100644 index 0000000..5fcdb6e --- /dev/null +++ b/include/Position @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamvalue.h" diff --git a/include/StringEngine b/include/StringEngine new file mode 100644 index 0000000..fceaf33 --- /dev/null +++ b/include/StringEngine @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamstringengine.h" diff --git a/include/Token b/include/Token new file mode 100644 index 0000000..c46a659 --- /dev/null +++ b/include/Token @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamexpression.h" diff --git a/include/UnaryOperator b/include/UnaryOperator new file mode 100644 index 0000000..dcdf78b --- /dev/null +++ b/include/UnaryOperator @@ -0,0 +1,2 @@ +//auto-generated code, do not change +#include "elamunary.h" diff --git a/src/elam.h b/include/elam.h similarity index 85% rename from src/elam.h rename to include/elam.h index d3806f9..b1017c9 100644 --- a/src/elam.h +++ b/include/elam.h @@ -23,8 +23,6 @@ See the ELAM namespace for member documentation. namespace ELAM { -///returns version information about ELAM -inline QString versionInfo(){return "0.2 alpha";} }; diff --git a/src/elambinary.h b/include/elambinary.h similarity index 98% rename from src/elambinary.h rename to include/elambinary.h index f0972bc..f18124c 100644 --- a/src/elambinary.h +++ b/include/elambinary.h @@ -11,6 +11,7 @@ #include #include "../dptr/dptr_base.h" +#include "elamglobal.h" #include @@ -36,7 +37,7 @@ typedef QVariant(*BinaryOperatorCall_FP)(const QVariant&op1,const QVariant&op2,E You can use the methods of this class to change the routines that handle the operator and the types on which it operates. Instances of this class are implicitly shared - meaning calls on a copy of an instance are also visible on the original and all other copies. */ -class BinaryOperator +class ELAM_EXPORT BinaryOperator { DECLARE_SHARED_DPTR(d); public: diff --git a/src/elamboolengine.h b/include/elamboolengine.h similarity index 93% rename from src/elamboolengine.h rename to include/elamboolengine.h index 379bb32..d74fc21 100644 --- a/src/elamboolengine.h +++ b/include/elamboolengine.h @@ -14,7 +14,7 @@ namespace ELAM { This engine type plays nicely with ELAM::IntEngine */ -class BoolEngine:public Engine +class ELAM_EXPORT BoolEngine:public Engine { public: ///instantiates a pre-configured engine diff --git a/src/elamcharclass.h b/include/elamcharclass.h similarity index 99% rename from src/elamcharclass.h rename to include/elamcharclass.h index a3c32e8..c08bcd5 100644 --- a/src/elamcharclass.h +++ b/include/elamcharclass.h @@ -48,7 +48,7 @@ None of these three classes may overlap. There are several more minor classes: - both surrounding another operator combine the operation with assignment (e.g. a+=b is equivalent to a=a+b) */ -class CharacterClassSettings +class ELAM_EXPORT CharacterClassSettings { DECLARE_SHARED_DPTR(d) public: diff --git a/src/elamengine.h b/include/elamengine.h similarity index 99% rename from src/elamengine.h rename to include/elamengine.h index 0912bb2..1dab137 100644 --- a/src/elamengine.h +++ b/include/elamengine.h @@ -21,6 +21,8 @@ namespace ELAM { +///returns version information about ELAM +ELAM_EXPORT QString versionInfo(); class Engine; @@ -84,7 +86,7 @@ Instances of this class can be configured to represent a specific system of func Methods of this class are used to evaluate expressions into final values. */ -class Engine:public QObject +class ELAM_EXPORT Engine:public QObject { Q_OBJECT DECLARE_DPTR(d); diff --git a/src/elamexpression.h b/include/elamexpression.h similarity index 96% rename from src/elamexpression.h rename to include/elamexpression.h index b804a05..2311fbf 100644 --- a/src/elamexpression.h +++ b/include/elamexpression.h @@ -14,7 +14,7 @@ namespace ELAM { /**Represents a single token in a parsed expression. Tokens are pretty stupid themselves - they just know their type, position, their original piece of text and an optional value (literals). They are used by the engine and expressions to transform text into executable expressions.*/ -class Token +class ELAM_EXPORT Token { DECLARE_SHARED_DPTR(d) public: @@ -108,16 +108,16 @@ class Token }; ///makes tokens accessable to qDebug() -QDebug& operator<<(QDebug,const Token&); +ELAM_EXPORT QDebug& operator<<(QDebug,const Token&); ///makes tokens accessable to qDebug() -QDebug& operator<<(QDebug,const QList&); +ELAM_EXPORT QDebug& operator<<(QDebug,const QList&); class Engine; /**Represents an expression in the context of its engine. An expression always has an engine as context and stores a hierarchy of operations (also expressions) to perform when called to evaluate. Expressions may become invalid if constants, functions, or operators change between the time they are created and the time they are evaluated. */ -class Expression +class ELAM_EXPORT Expression { DECLARE_SHARED_DPTR(d) public: @@ -168,7 +168,7 @@ class Expression }; ///makes expressions accessable to qDebug() -QDebug& operator<<(QDebug,const Expression&); +ELAM_EXPORT QDebug& operator<<(QDebug,const Expression&); //end of namespace }; diff --git a/src/elamfloatengine.h b/include/elamfloatengine.h similarity index 93% rename from src/elamfloatengine.h rename to include/elamfloatengine.h index b850789..0a5c133 100644 --- a/src/elamfloatengine.h +++ b/include/elamfloatengine.h @@ -16,7 +16,7 @@ This engine type plays nice with the IntEngine functions by supplemening its ope Per default only the float versions are pre-installed. Use IntEngine::configureIntEngine or IntFloatEngine to have both. */ -class FloatEngine:public Engine +class ELAM_EXPORT FloatEngine:public Engine { public: ///instantiates a pre-initialized engine @@ -32,7 +32,7 @@ class FloatEngine:public Engine }; ///an engine with integer and float math pre-installed, see IntEngine and FloatEngine -class IntFloatEngine:public Engine +class ELAM_EXPORT IntFloatEngine:public Engine { public: ///instantiates a pre-installed engine diff --git a/include/elamglobal.h b/include/elamglobal.h new file mode 100644 index 0000000..0f7f4d4 --- /dev/null +++ b/include/elamglobal.h @@ -0,0 +1,18 @@ +//ELAM global definitions header +// +// (c) Konrad Rosenbaum, 2012 +// protected under the GNU LGPL v3 or at your option any newer + +#ifndef ELAM_GLOBAL_H +#define ELAM_GLOBAL_H + +//export for DLL +#include + +#if defined(ELAM_LIBRARY_BUILD) +# define ELAM_EXPORT Q_DECL_EXPORT +#else +# define ELAM_EXPORT Q_DECL_IMPORT +#endif + +#endif diff --git a/src/elamintengine.h b/include/elamintengine.h similarity index 92% rename from src/elamintengine.h rename to include/elamintengine.h index 71ae4ec..5f7acc4 100644 --- a/src/elamintengine.h +++ b/include/elamintengine.h @@ -11,7 +11,7 @@ namespace ELAM { ///integer math enabled engine -class IntEngine:public Engine +class ELAM_EXPORT IntEngine:public Engine { public: ///instantiates a pre-configured engine diff --git a/src/elamstringengine.h b/include/elamstringengine.h similarity index 92% rename from src/elamstringengine.h rename to include/elamstringengine.h index de35cd9..931cf39 100644 --- a/src/elamstringengine.h +++ b/include/elamstringengine.h @@ -11,7 +11,7 @@ namespace ELAM { ///integer math enabled engine -class StringEngine:public Engine +class ELAM_EXPORT StringEngine:public Engine { public: ///instantiates a pre-configured engine diff --git a/src/elamunary.h b/include/elamunary.h similarity index 99% rename from src/elamunary.h rename to include/elamunary.h index f79af2c..79561d7 100644 --- a/src/elamunary.h +++ b/include/elamunary.h @@ -35,7 +35,7 @@ typedef QVariant(*UnaryOperatorCall_FP)(const QVariant&op,Engine&engine); You can use the methods of this class to change the routines that handle the operator and the types on which it operates. Instances of this class are implicitly shared - meaning calls on a copy of an instance are also visible on the original and all other copies. */ -class UnaryOperator +class ELAM_EXPORT UnaryOperator { DECLARE_SHARED_DPTR(d); public: diff --git a/src/elamvalue.h b/include/elamvalue.h similarity index 95% rename from src/elamvalue.h rename to include/elamvalue.h index 4a8ccfc..7ebcc94 100644 --- a/src/elamvalue.h +++ b/include/elamvalue.h @@ -11,6 +11,8 @@ #include #include +#include "elamglobal.h" + namespace ELAM { /** \brief A character position inside a text/string that is being evaluated. @@ -18,7 +20,7 @@ namespace ELAM { A position consists of line and column. The top left position in a text is assumed to be line 1 column 1. Any position with line and/or column less than zero is considered invalid. This class is completely inline and as such should be quite fast.*/ -class Position +class ELAM_EXPORT Position { public: ///converts a pair of ints to a position @@ -55,10 +57,10 @@ class Position private: int mline,mcol; }; -QDebug&operator<<(QDebug,const Position&); +ELAM_EXPORT QDebug&operator<<(QDebug,const Position&); /**Objects of this class represent an exception in the evaluation of an ELAM expression.*/ -class Exception +class ELAM_EXPORT Exception { public: ///Type of Exception @@ -129,10 +131,10 @@ class Exception Position mpos; }; -QDebug&operator<<(QDebug,const Exception&); +ELAM_EXPORT QDebug&operator<<(QDebug,const Exception&); /**this type is not actually used, its ID is used as a fallback to tell operators, functions and engines that any supported type can be used*/ -class AnyType +class ELAM_EXPORT AnyType { public: ///returns the meta type ID of the ANY type diff --git a/src/elam.pro b/src/elam.pro index 982c04b..adf6142 100644 --- a/src/elam.pro +++ b/src/elam.pro @@ -1,12 +1,13 @@ TEMPLATE = lib TARGET = elam DESTDIR = .. -CONFIG += staticlib create_prl +CONFIG += dll create_prl QT -= gui OBJECTS_DIR = .ctmp MOC_DIR = .ctmp RCC_DIR = .ctmp - +DEFINES += ELAM_LIBRARY_BUILD +VERSION = 0.3.0 HEADERS += \ elam.h \ @@ -33,7 +34,7 @@ SOURCES += \ elamboolengine.cpp \ elamstringengine.cpp -INCLUDEPATH += . -DEPENDPATH += . +INCLUDEPATH += . ../include +DEPENDPATH += . ../include ../dptr QMAKE_CXXFLAGS+=-std=gnu++0x \ No newline at end of file diff --git a/src/elamengine.cpp b/src/elamengine.cpp index 569248e..9b5a7d4 100644 --- a/src/elamengine.cpp +++ b/src/elamengine.cpp @@ -10,6 +10,8 @@ #include "../dptr/dptr.h" namespace ELAM { + +ELAM_EXPORT QString versionInfo(){return "0.3 alpha";} /////////////////////////////////////////////////////////////////////////////// // Engine