diff options
Diffstat (limited to 'csv')
-rw-r--r-- | csv/CMakeLists.txt | 2 | ||||
-rw-r--r-- | csv/csv.cpp | 2 | ||||
-rw-r--r-- | csv/csv.h | 10 | ||||
-rw-r--r-- | csv/export.hpp | 18 | ||||
-rw-r--r-- | csv/import.hpp | 13 |
5 files changed, 36 insertions, 9 deletions
diff --git a/csv/CMakeLists.txt b/csv/CMakeLists.txt index ef6a3b44..b4c41673 100644 --- a/csv/CMakeLists.txt +++ b/csv/CMakeLists.txt @@ -1 +1 @@ -opentrack_boilerplate(opentrack-csv STATIC) +opentrack_boilerplate(opentrack-csv) diff --git a/csv/csv.cpp b/csv/csv.cpp index a5dc93f5..09944154 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -91,7 +91,7 @@ bool CSV::parseLine(QStringList& ret) return true; } -bool CSV::getGameData(const int id, unsigned char* table, QString& gamename) +bool CSV::getGameData(int id, unsigned char* table, QString& gamename) { for (int i = 0; i < 8; i++) table[i] = 0; @@ -7,20 +7,16 @@ #include <QRegExp> #include <QtGlobal> -#ifdef BUILD_csv -# define CSV_EXPORT Q_DECL_EXPORT -#else -# define CSV_EXPORT Q_DECL_IMPORT -#endif +#include "export.hpp" -class CSV_EXPORT CSV +class OPENTRACK_CSV_EXPORT CSV { public: QString readLine(); bool parseLine(QStringList& ret); void setCodec(const char* codecName); - static bool getGameData(const int gameID, unsigned char* table, QString& gamename); + static bool getGameData(int gameID, unsigned char* table, QString& gamename); private: CSV(QIODevice* device); diff --git a/csv/export.hpp b/csv/export.hpp new file mode 100644 index 00000000..506833c4 --- /dev/null +++ b/csv/export.hpp @@ -0,0 +1,18 @@ +#pragma once + +#ifdef BUILD_csv +# ifdef _WIN32 +# define OPENTRACK_CSV_LINKAGE __declspec(dllexport) +# else +# define OPENTRACK_CSV_LINKAGE +# endif + +# ifndef _MSC_VER +# define OPENTRACK_CSV_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_CSV_LINKAGE +# else +# define OPENTRACK_CSV_EXPORT OPENTRACK_CSV_LINKAGE +# endif + +#else +# include "import.hpp" +#endif diff --git a/csv/import.hpp b/csv/import.hpp new file mode 100644 index 00000000..5fcfdd58 --- /dev/null +++ b/csv/import.hpp @@ -0,0 +1,13 @@ +#pragma once + +#ifdef _WIN32 +# define OPENTRACK_CSV_LINKAGE __declspec(dllimport) +#else +# define OPENTRACK_CSV_LINKAGE +#endif + +#ifndef _MSC_VER +# define OPENTRACK_CSV_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_CSV_LINKAGE +#else +# define OPENTRACK_CSV_EXPORT OPENTRACK_CSV_LINKAGE +#endif |