* Compatibility fixes for VS2019 4.x-dev

Fri, 15 Nov 2019 20:19:57 +0200

author
cemkalyoncu
date
Fri, 15 Nov 2019 20:19:57 +0200
branch
4.x-dev
changeset 1306
9fec2f1bb65a
parent 1305
30a9c1909c1f
child 1307
bc885367b17d

* Compatibility fixes for VS2019

.hgignore file | annotate | diff | comparison | revisions
Source/Gorgon/Enum.h file | annotate | diff | comparison | revisions
Source/Gorgon/Event.h file | annotate | diff | comparison | revisions
Source/Gorgon/String.h file | annotate | diff | comparison | revisions
Source/Gorgon/UI/Template.h file | annotate | diff | comparison | revisions
--- a/.hgignore	Wed Nov 13 19:34:25 2019 +0200
+++ b/.hgignore	Fri Nov 15 20:19:57 2019 +0200
@@ -35,5 +35,7 @@
 *.orig
 *.backup
 
+CMakeSettings.json
+.vs
 syntax: regexp
 .*\.kdev4(_.*)?
--- a/Source/Gorgon/Enum.h	Wed Nov 13 19:34:25 2019 +0200
+++ b/Source/Gorgon/Enum.h	Fri Nov 15 20:19:57 2019 +0200
@@ -8,13 +8,6 @@
 #include <vector>
 #include "String/Exceptions.h"
 
-#ifdef _MSC_VER
-#	define decltype(...) std::identity<decltype(__VA_ARGS__)>::type
-#	define decltypetype(...) typename decltype(__VA_ARGS__)
-#else
-#	define decltypetype(...) decltype(__VA_ARGS__)
-#endif
-
 /// @cond INTERNAL
 class gorgon__no_enum_trait {
 public:
@@ -147,7 +140,7 @@
 		}
 		
 	private:
-		const decltypetype(gorgon__enum_tr_loc(T_())) traits;
+		const decltype(gorgon__enum_tr_loc(T_())) traits;
 		std::map<std::string, T_> reversemapping;
 		std::vector<T_> listing;
 	};
@@ -367,10 +360,3 @@
 		return in;
 	}
 }
-
-#ifdef _MSC_VER
-#	undef decltype
-#	undef decltypetype
-#else
-#	undef decltypetype
-#endif
--- a/Source/Gorgon/Event.h	Wed Nov 13 19:34:25 2019 +0200
+++ b/Source/Gorgon/Event.h	Fri Nov 15 20:19:57 2019 +0200
@@ -160,6 +160,7 @@
 		
 		/// Move constructor
 		Event(Event &&event) : source(nullptr) {
+			fire.clear();
 			Swap(event);
 #ifndef NDEBUG
 			event.movedout = true;
@@ -192,9 +193,8 @@
 			handlers.Destroy();
 
 			source=nullptr;
+			fire.clear();
 			Swap(other);
-
-			fire.clear();
 		}
 
 		/// Swaps two Events, used for move semantics
--- a/Source/Gorgon/String.h	Wed Nov 13 19:34:25 2019 +0200
+++ b/Source/Gorgon/String.h	Fri Nov 15 20:19:57 2019 +0200
@@ -80,20 +80,9 @@
 		
 		/// @cond
 
-#ifdef _MSC_VER
-#	define decltype(...) std::identity<decltype(__VA_ARGS__)>::type
-#	define decltypetype(...) typename decltype(__VA_ARGS__)
-#	define ISENUMUPGRADED enumupgradedhelper<T_>::value
-	template<class T_>
-	struct enumupgradedhelper {
-		enum {
-			value = decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum,
-		};
-	};
-#else
-#	define decltypetype(...) decltype(__VA_ARGS__)
+
 #	define ISENUMUPGRADED	decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum
-#endif
+
 		template <class T_>
 		typename std::enable_if<std::is_constructible<T_, std::string>::value, T_>::type
 		To(const std::string &value) {
@@ -518,7 +507,7 @@
 			};
 
 			template<class TT>
-			static one test(decltypetype(((std::ostream*)nullptr)->operator<<((TT*)nullptr)))  { return one(); }
+			static one test(decltype(((std::ostream*)nullptr)->operator<<((TT*)nullptr)))  { return one(); }
 			
 			static two test(...)  { return two();  }
 						
@@ -838,11 +827,4 @@
 	}
 }
 
-#ifdef _MSC_VER
-#	undef decltype
-#	undef decltypetype
 #	undef ISENUMUPGRADED
-#else
-#	undef decltypetype
-#	undef ISENUMUPGRADED
-#endif
--- a/Source/Gorgon/UI/Template.h	Wed Nov 13 19:34:25 2019 +0200
+++ b/Source/Gorgon/UI/Template.h	Fri Nov 15 20:19:57 2019 +0200
@@ -773,9 +773,9 @@
         std::vector<Event<ComponentTemplate>::Token> tokens;
         std::map<std::pair<ComponentCondition, ComponentCondition>, int> durations;
 
-		SizeMode xsizing, ysizing;
+		SizeMode xsizing = Free, ysizing = Free;
 		Geometry::Size size;
-		Geometry::Size additional;
+		Geometry::Size additional = {0, 0};
 	};
 
 	/// Defines an object according to the Box Model.

mercurial