Skip to content
Snippets Groups Projects
Commit 691f5461 authored by Olivier SOLDANO's avatar Olivier SOLDANO Committed by Anthony Léonard
Browse files

mingw compatibility patch


when sanitizing the namespaces of client-windows, encontered few
incompatibilities due to windows.h inclusion. This header file defines a
lot of common macros such as ERROR... This patch wraps all conflics with
push/pop macro pragmas.

Change-Id: I7f95fac84ace5388e7134db372bd36720210f886
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 7bf0da94
Branches
No related tags found
No related merge requests found
......@@ -152,6 +152,8 @@ public:
///Possible call states
enum class State : unsigned int{
#pragma push_macro("ERROR")
#undef ERROR
NEW = 0, /*!< The call has been created, but no dialing number been set */
INCOMING = 1, /*!< Ringing incoming call */
RINGING = 2, /*!< Ringing outgoing call */
......@@ -170,6 +172,7 @@ public:
ABORTED = 15,/*!< The call was dropped before being sent to the daemon */
CONNECTED = 16,/*!< The peer has been found, attempting negotiation */
COUNT__,
#pragma pop_macro("ERROR")
};
Q_ENUMS(State)
......@@ -223,10 +226,16 @@ public:
* only used for outgoing holding.
*/
enum class HoldFlags {
#pragma push_macro("OUT")
#pragma push_macro("IN")
#undef OUT
#undef IN
NONE = 0x0 << 0, /*!< The call is not on hold */
OUT = 0x1 << 0, /*!< This side put the peer on hold */
IN = 0x1 << 1, /*!< The peer put this side on hold */
COUNT__
#pragma pop_macro("OUT")
#pragma pop_macro("IN")
};
Q_FLAGS(HoldFlags)
......
......@@ -61,14 +61,16 @@ T* Call::firstMedia(Media::Media::Direction direction) const
template<typename T>
T* Call::addOutgoingMedia(bool useExisting)
{
#pragma push_macro("OUT")
#undef OUT
T* existing = firstMedia<T>(Media::Media::Direction::OUT);
if (useExisting && existing)
return existing;
Media::Media::Type t = MediaTypeInference::getType<T>();
return static_cast<T*>(MediaTypeInference::safeMediaCreator(this,t,Media::Media::Direction::OUT));
#pragma pop_macro("OUT")
}
#define REGISTER_MEDIA() __attribute__ ((unused)) static auto forceType = [] {\
......
......@@ -72,7 +72,7 @@ public:
virtual QVariant securityIssueIcon(const QModelIndex& index) = 0;
virtual QByteArray toByteArray(const QVariant& pxm) = 0;
virtual QVariant personPhoto(const QByteArray& data, const QString& type = "PNG") = 0;
virtual QVariant collectionIcon(const CollectionInterface* interface, PixmapManipulatorI::CollectionIconHint hint = PixmapManipulatorI::CollectionIconHint::NONE) const = 0;
virtual QVariant collectionIcon(const CollectionInterface* colItf, PixmapManipulatorI::CollectionIconHint hint = PixmapManipulatorI::CollectionIconHint::NONE) const = 0;
virtual QVariant securityLevelIcon(const SecurityEvaluationModel::SecurityLevel level) const = 0;
virtual QVariant historySortingCategoryIcon(const CategorizedHistoryModel::SortedProxy::Categories cat) const = 0;
virtual QVariant contactSortingCategoryIcon(const CategorizedContactModel::SortedProxy::Categories cat) const = 0;
......
......@@ -52,9 +52,15 @@ public:
};
enum class Direction {
#pragma push_macro("OUT")
#pragma push_macro("IN")
#undef OUT
#undef IN
IN , /*!< The media is coming from the peer */
OUT, /*!< The media is going to the peer */
COUNT__
#pragma pop_macro("OUT")
#pragma pop_macro("IN")
};
enum class Action {
......@@ -98,4 +104,3 @@ private:
Q_DECLARE_METATYPE(Media::Media::Direction)
Media::Media* operator<<(Media::Media* m, Media::Media::Action a);
......@@ -87,6 +87,8 @@ public:
///The severity of a given flaw
enum class Severity {
#pragma push_macro("ERROR")
#undef ERROR
UNSUPPORTED = 0, /*!< This severity is unsupported, to be ignored */
INFORMATION = 1, /*!< Tip and tricks to have better security */
WARNING = 2, /*!< It is a problem, but it won't have other side effects */
......@@ -94,9 +96,9 @@ public:
ERROR = 4, /*!< It simply won't work (REGISTER) */
FATAL_WARNING = 5, /*!< Registration may work, but it render everything else useless */
COUNT__,
#pragma pop_macro("ERROR")
};
Q_ENUMS(Severity)
///Every supported flaws
enum class AccountSecurityChecks {
SRTP_ENABLED , /*!< The account use secure media streams */
......@@ -160,4 +162,3 @@ private:
Q_DECLARE_METATYPE(SecurityEvaluationModel*)
Q_DECLARE_METATYPE(SecurityEvaluationModel::Severity)
Q_DECLARE_METATYPE(SecurityEvaluationModel::SecurityLevel)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment