Skip to content

Commit

Permalink
Change MPUBLIC to be unique per library
Browse files Browse the repository at this point in the history
This change is related to MPUBLIC defined in mythexp.h.  The way it's
used today is incompatible with VS.  What has been committed is as follows:

  * Each library has its own mythXXXexp.h file.
  * Each library .pro file has a DEFINE added which is used in the
    mythXXXexp.h to determine if the symbol is being imported or exported
  * MPUBLIC has been replaced in each source file with one specific for
    the library in question.

These changes have been made to each library / program that uses mythexp.h.
  • Loading branch information
dblain committed Feb 15, 2011
1 parent f76028b commit 26ea667
Show file tree
Hide file tree
Showing 183 changed files with 714 additions and 588 deletions.
3 changes: 3 additions & 0 deletions mythtv/libs/libmyth/libmyth.pro
Expand Up @@ -5,6 +5,8 @@ TARGET = myth-$$LIBVERSION
CONFIG += thread dll
target.path = $${LIBDIR}
INSTALLS = target
DEFINES += MYTH_API


QT += network xml sql

Expand Down Expand Up @@ -34,6 +36,7 @@ HEADERS += programinfo.h programinfoupdater.h
HEADERS += programtypes.h recordingtypes.h
HEADERS += mythrssmanager.h netgrabbermanager.h
HEADERS += rssparse.h netutils.h
HEADERS += mythexp.h

# remove when everything is switched to mythui
HEADERS += virtualkeyboard_qt.h
Expand Down
22 changes: 22 additions & 0 deletions mythtv/libs/libmyth/mythexp.h
@@ -0,0 +1,22 @@
#ifndef MYTHEXP_H_
#define MYTHEXP_H_

#include <QtCore/qglobal.h>

#ifdef MYTH_API
# define MPUBLIC Q_DECL_EXPORT
#else
# define MPUBLIC Q_DECL_IMPORT
#endif

#if (__GNUC__ >= 4)
# define MHIDDEN __attribute__((visibility("hidden")))
# define MUNUSED __attribute__((unused))
# define MDEPRECATED __attribute__((deprecated))
#else
# define MHIDDEN
# define MUNUSED
# define MDEPRECATED
#endif

#endif // MYTHEXP_H_
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/mythmediamonitor.h
Expand Up @@ -7,6 +7,7 @@
#include <QMutex>
#include <QList>

#include "mythexp.h"
#include "mythmedia.h"

/// Stores details of media handlers
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/output.h
Expand Up @@ -18,6 +18,7 @@ using namespace std;
#include <QList>

#include "mythobservable.h"
#include "mythexp.h"

class QObject;
class Buffer;
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/rawsettingseditor.h
Expand Up @@ -5,6 +5,7 @@
#include <QHash>
#include <QObject>

#include "mythexp.h"
#include "mythscreentype.h"

#include "mythuibutton.h"
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/schemawizard.h
Expand Up @@ -4,6 +4,7 @@
#include <QObject>
#include <QString>

#include "mythexp.h"
#include "dbutil.h"
#include "mythmainwindow.h"
#include "mythprogressdialog.h"
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/dbutil.h
Expand Up @@ -3,7 +3,7 @@

#include <QStringList>

#include "mythexp.h"
#include "mythbaseexp.h"
#include "mythdbcon.h"

enum MythDBBackupStatus
Expand All @@ -27,7 +27,7 @@ enum MythDBBackupStatus
*
* \sa HouseKeeper::RunHouseKeeping(void)
*/
class MPUBLIC DBUtil
class MBASE_PUBLIC DBUtil
{
public:
DBUtil();
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/decodeencode.h
Expand Up @@ -8,10 +8,10 @@ using namespace std;

// This is necessary for GCC 3.3, which has llabs(long long)
// // but not abs(long long) or std::llabs(long long)
MPUBLIC inline long long absLongLong(long long n) { return n >= 0 ? n : -n; }
MBASE_PUBLIC inline long long absLongLong(long long n) { return n >= 0 ? n : -n; }

MPUBLIC void encodeLongLong(QStringList &list, long long num);
MPUBLIC long long decodeLongLong(QStringList &list, uint offset);
MPUBLIC long long decodeLongLong(QStringList &list, QStringList::const_iterator &it);
MBASE_PUBLIC void encodeLongLong(QStringList &list, long long num);
MBASE_PUBLIC long long decodeLongLong(QStringList &list, uint offset);
MBASE_PUBLIC long long decodeLongLong(QStringList &list, QStringList::const_iterator &it);

#endif // DECODEENCODE_H_
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/httpcomms.h
Expand Up @@ -7,10 +7,10 @@
#include <QHttp>
#include <QUrl>

#include "mythexp.h"
#include "mythbaseexp.h"

class QTimer;
class MPUBLIC HttpComms : public QObject
class MBASE_PUBLIC HttpComms : public QObject
{
Q_OBJECT
public:
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythbase/iso3166.h
Expand Up @@ -10,9 +10,9 @@ using namespace std;
#include <QStringList>
#include <QMap>

#include "mythexp.h"
#include "mythbaseexp.h"

extern MPUBLIC QMap<int, QString> _iso3166_key_to_english_name;
extern MBASE_PUBLIC QMap<int, QString> _iso3166_key_to_english_name;

/** \file iso3166.h
* \brief ISO 3166-1 support functions
Expand All @@ -28,9 +28,9 @@ extern MPUBLIC QMap<int, QString> _iso3166_key_to_english_name;

typedef QMap<QString, QString> CodeToNameMap;

MPUBLIC CodeToNameMap GetISO3166EnglishCountryMap(void);
MPUBLIC QString GetISO3166EnglishCountryName(QString iso3166Code);
MPUBLIC CodeToNameMap GetISO3166CountryMap();
MPUBLIC QString GetISO3166CountryName(QString iso3166Code);
MBASE_PUBLIC CodeToNameMap GetISO3166EnglishCountryMap(void);
MBASE_PUBLIC QString GetISO3166EnglishCountryName(QString iso3166Code);
MBASE_PUBLIC CodeToNameMap GetISO3166CountryMap();
MBASE_PUBLIC QString GetISO3166CountryName(QString iso3166Code);

#endif // _ISO_3166_1_H_
22 changes: 11 additions & 11 deletions mythtv/libs/libmythbase/iso639.h
Expand Up @@ -9,9 +9,9 @@ using namespace std;
#include <QStringList>
#include <QMap>

#include "mythexp.h"
#include "mythbaseexp.h"

extern MPUBLIC QMap<int, QString> _iso639_key_to_english_name;
extern MBASE_PUBLIC QMap<int, QString> _iso639_key_to_english_name;

/** \file iso639.h
* \brief ISO 639-1 and ISO 639-2 support functions
Expand All @@ -34,14 +34,14 @@ extern MPUBLIC QMap<int, QString> _iso639_key_to_english_name;
*/

/// Converts a 2 or 3 character iso639 string to a language name in English.
MPUBLIC QString iso639_str_toName(const unsigned char *iso639);
MBASE_PUBLIC QString iso639_str_toName(const unsigned char *iso639);
/// Converts a canonical key to language name in English
MPUBLIC QString iso639_key_toName(int iso639_2);
MPUBLIC void iso639_clear_language_list(void);
MPUBLIC QStringList iso639_get_language_list(void);
MPUBLIC vector<int> iso639_get_language_key_list(void);
MPUBLIC int iso639_key_to_canonical_key(int iso639_2);
MPUBLIC QString iso639_str2_to_str3(const QString &str2);
MBASE_PUBLIC QString iso639_key_toName(int iso639_2);
MBASE_PUBLIC void iso639_clear_language_list(void);
MBASE_PUBLIC QStringList iso639_get_language_list(void);
MBASE_PUBLIC vector<int> iso639_get_language_key_list(void);
MBASE_PUBLIC int iso639_key_to_canonical_key(int iso639_2);
MBASE_PUBLIC QString iso639_str2_to_str3(const QString &str2);

static inline QString iso639_key_to_str3(int code)
{
Expand Down Expand Up @@ -97,7 +97,7 @@ static inline QString iso639_str_to_canonoical_str(const QString &str3)

typedef QMap<QString, QString> CodeToNameMap;

MPUBLIC QString GetISO639LanguageName(QString iso639Code);
MPUBLIC QString GetISO639EnglishLanguageName(QString iso639Code);
MBASE_PUBLIC QString GetISO639LanguageName(QString iso639Code);
MBASE_PUBLIC QString GetISO639EnglishLanguageName(QString iso639Code);

#endif // _ISO_639_2_H_
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/lcddevice.h
Expand Up @@ -10,12 +10,12 @@
#include <QMutex>
#include <QList>

#include "mythexp.h"
#include "mythbaseexp.h"
#include "mythsocket_cb.h"

enum CHECKED_STATE {CHECKED = 0, UNCHECKED, NOTCHECKABLE };

class MPUBLIC LCDMenuItem
class MBASE_PUBLIC LCDMenuItem
{
public:
LCDMenuItem(bool item_selected, CHECKED_STATE item_checked,
Expand Down Expand Up @@ -56,7 +56,7 @@ class MPUBLIC LCDMenuItem

enum TEXT_ALIGNMENT {ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTERED };

class MPUBLIC LCDTextItem
class MBASE_PUBLIC LCDTextItem
{
public:
LCDTextItem(unsigned int row, TEXT_ALIGNMENT align, QString text,
Expand Down Expand Up @@ -169,7 +169,7 @@ enum LCDFunctionSet {
FUNC_NEWS = 7 << 1,
};

class MPUBLIC LCD : public QObject, public MythSocketCBs
class MBASE_PUBLIC LCD : public QObject, public MythSocketCBs
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythbase/libmythbase.pro
Expand Up @@ -11,7 +11,7 @@ QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)

# Input
HEADERS += mythsocket.h mythsocket_cb.h mythsocketthread.h msocketdevice.h
HEADERS += mythexp.h mythdbcon.h mythdb.h mythdbparams.h oldsettings.h
HEADERS += mythbaseexp.h mythdbcon.h mythdb.h mythdbparams.h oldsettings.h
HEADERS += mythverbose.h mythversion.h compat.h mythconfig.h
HEADERS += mythobservable.h mythevent.h httpcomms.h mcodecs.h
HEADERS += mythtimer.h mythsignalingtimer.h mythdirs.h exitcodes.h
Expand Down Expand Up @@ -47,7 +47,7 @@ mingw {

# Install headers to same location as libmyth to make things easier
inc.path = $${PREFIX}/include/mythtv/
inc.files = mythverbose.h mythdbcon.h mythdbparams.h mythexp.h mythdb.h
inc.files = mythverbose.h mythdbcon.h mythdbparams.h mythbaseexp.h mythdb.h
inc.files += compat.h mythversion.h mythconfig.h mythconfig.mak
inc.files += mythobservable.h mythevent.h httpcomms.h mcodecs.h
inc.files += mythtimer.h lcddevice.h exitcodes.h mythdirs.h mythstorage.h
Expand All @@ -68,6 +68,7 @@ INSTALLS += inc inc2 inc3

DEFINES += RUNPREFIX=\\\"$${RUNPREFIX}\\\"
DEFINES += LIBDIRNAME=\\\"$${LIBDIRNAME}\\\"
DEFINES += MBASE_API

linux:DEFINES += linux

Expand Down
28 changes: 14 additions & 14 deletions mythtv/libs/libmythbase/mcodecs.h
Expand Up @@ -36,7 +36,7 @@

#define QBase64 QCodecs

#include "mythexp.h"
#include "mythbaseexp.h"

class QByteArray;
class QIODevice;
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace QCodecs
* breaks, too.
* @return quoted-printable encoded string.
*/
MPUBLIC QByteArray quotedPrintableEncode(const QByteArray & in,
MBASE_PUBLIC QByteArray quotedPrintableEncode(const QByteArray & in,
bool useCRLF = true);

/**
Expand All @@ -103,7 +103,7 @@ namespace QCodecs
* CRLF line breaks and the output will have CRLF line
* breaks, too.
*/
MPUBLIC void quotedPrintableEncode(const QByteArray & in, QByteArray& out,
MBASE_PUBLIC void quotedPrintableEncode(const QByteArray & in, QByteArray& out,
bool useCRLF);

/**
Expand All @@ -114,7 +114,7 @@ namespace QCodecs
* @param in data to be decoded.
* @return decoded string.
*/
MPUBLIC QByteArray quotedPrintableDecode(const QByteArray & in);
MBASE_PUBLIC QByteArray quotedPrintableDecode(const QByteArray & in);

/**
* Decodes a quoted-printable encoded data.
Expand All @@ -133,7 +133,7 @@ namespace QCodecs
* @param in data to be decoded.
* @param out decoded data.
*/
MPUBLIC void quotedPrintableDecode(const QByteArray & in, QByteArray& out);
MBASE_PUBLIC void quotedPrintableDecode(const QByteArray & in, QByteArray& out);


/**
Expand All @@ -147,7 +147,7 @@ namespace QCodecs
* @param in data to be uuencoded
* @return uuencoded string.
*/
MPUBLIC QByteArray uuencode( const QByteArray& in );
MBASE_PUBLIC QByteArray uuencode( const QByteArray& in );

/**
* Encodes the given data using the uuencode algorithm.
Expand All @@ -164,7 +164,7 @@ namespace QCodecs
* @param in data to be uuencoded.
* @param out uudecoded data.
*/
MPUBLIC void uuencode( const QByteArray& in, QByteArray& out );
MBASE_PUBLIC void uuencode( const QByteArray& in, QByteArray& out );

/**
* Decodes the given data using the uudecode algorithm.
Expand All @@ -176,7 +176,7 @@ namespace QCodecs
* @param in data to be decoded.
* @return decoded string.
*/
MPUBLIC QByteArray uudecode( const QByteArray& in );
MBASE_PUBLIC QByteArray uudecode( const QByteArray& in );

/**
* Decodes the given data using the uudecode algorithm.
Expand All @@ -197,7 +197,7 @@ namespace QCodecs
* @param in data to be decoded.
* @param out uudecoded data.
*/
MPUBLIC void uudecode( const QByteArray& in, QByteArray& out );
MBASE_PUBLIC void uudecode( const QByteArray& in, QByteArray& out );


/**
Expand All @@ -213,7 +213,7 @@ namespace QCodecs
*
* @return base64 encoded string.
*/
MPUBLIC QByteArray base64Encode( const QByteArray& in, bool insertLFs = false);
MBASE_PUBLIC QByteArray base64Encode( const QByteArray& in, bool insertLFs = false);

/**
* Encodes the given data using the base64 algorithm.
Expand All @@ -236,7 +236,7 @@ namespace QCodecs
* @param out encoded data.
* @param insertLFs limit the number of characters per line.
*/
MPUBLIC void base64Encode( const QByteArray& in, QByteArray& out,
MBASE_PUBLIC void base64Encode( const QByteArray& in, QByteArray& out,
bool insertLFs = false );

/**
Expand All @@ -246,7 +246,7 @@ namespace QCodecs
* @param in data to be decoded.
* @return decoded string.
*/
MPUBLIC QByteArray base64Decode( const QByteArray& in );
MBASE_PUBLIC QByteArray base64Decode( const QByteArray& in );

/**
* Decodes the given data that was encoded with the base64
Expand All @@ -265,7 +265,7 @@ namespace QCodecs
* @param in data to be decoded.
* @param out decoded data.
*/
MPUBLIC void base64Decode( const QByteArray& in, QByteArray& out );
MBASE_PUBLIC void base64Decode( const QByteArray& in, QByteArray& out );

}

Expand Down Expand Up @@ -315,7 +315,7 @@ class QMD5Private;
* @author Dirk Mueller <mueller@kde.org>, Dawit Alemayehu <adawit@kde.org>
*/

class MPUBLIC QMD5
class MBASE_PUBLIC QMD5
{
public:

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/msocketdevice.h
Expand Up @@ -47,11 +47,11 @@
#include <QIODevice>
#include <QHostAddress> // int->QHostAddress conversion

#include "mythexp.h"
#include "mythbaseexp.h"

class MSocketDevicePrivate;

class MPUBLIC MSocketDevice: public QIODevice
class MBASE_PUBLIC MSocketDevice: public QIODevice
{
public:
enum Type { Stream, Datagram };
Expand Down

0 comments on commit 26ea667

Please sign in to comment.