Roberto Parolin 6 yıl önce
ebeveyn
işleme
ea91a59d1e

+ 0 - 2
.gitignore

@@ -1,4 +1,2 @@
 tags
-build
-build.bat
 

+ 41 - 0
include/Common/EABase/config/eacompiler.h

@@ -100,6 +100,9 @@
  *  C++17 functionality
  *     EA_COMPILER_NO_INLINE_VARIABLES
  *     EA_COMPILER_NO_ALIGNED_NEW
+ *
+ *  C++20 functionality
+ *     EA_COMPILER_NO_DESIGNATED_INITIALIZERS
  *     
  *-----------------------------------------------------------------------------
  *
@@ -300,6 +303,26 @@
 	#endif
 
 
+	// EA_COMPILER_CPP20_ENABLED
+	//
+	// Defined as 1 if the compiler has its available C++20 support enabled, else undefined.
+	// This does not mean that all of C++20 or any particular feature of C++20 is supported
+	// by the compiler. It means that whatever C++20 support the compiler has is enabled.
+ 	//
+	// We cannot use (__cplusplus >= 202003L) alone because some compiler vendors have
+	// decided to not define __cplusplus like thus until they have fully completed their
+	// C++20 support.
+	#if !defined(EA_COMPILER_CPP20_ENABLED) && defined(__cplusplus)
+ 		// TODO(rparoin): enable once a C++20 value for the __cplusplus macro has been published
+		// #if (__cplusplus >= 202003L)
+		//     #define EA_COMPILER_CPP20_ENABLED 1
+		// #elif defined(_MSVC_LANG) && (_MSVC_LANG >= 202003L) // C++20+
+		//     #define EA_COMPILER_CPP20_ENABLED 1
+		// #endif
+	#endif
+
+
+
 	#if   defined(__ARMCC_VERSION)
 		// Note that this refers to the ARM RVCT compiler (armcc or armcpp), but there
 		// are other compilers that target ARM processors, such as GCC and Microsoft VC++.
@@ -1290,6 +1313,24 @@
 	#endif
 
 
+	// EA_COMPILER_NO_DESIGNATED_INITIALIZERS
+	//
+	// Indicates the target compiler supports the C++20 "designated initializer" language feature.
+	// https://en.cppreference.com/w/cpp/language/aggregate_initialization
+	//
+	// Example:
+	//   struct A { int x; int y; };
+	//   A a = { .y = 42, .x = 1 };
+	//
+	#if !defined(EA_COMPILER_NO_DESIGNATED_INITIALIZERS)
+		#if defined(EA_COMPILER_CPP20_ENABLED)
+			// supported.
+		#else
+			#define EA_COMPILER_NO_DESIGNATED_INITIALIZERS 1
+		#endif
+	#endif
+
+
 	// EA_COMPILER_NO_NONSTATIC_MEMBER_INITIALIZERS
 	//
 	// Refers to C++11 declaration attribute: carries_dependency.

+ 4 - 4
include/Common/EABase/config/eaplatform.h

@@ -125,7 +125,7 @@
 	#endif
 
 
-#elif defined(EA_PLATFORM_XBOXONE) || defined(_DURANGO) || defined(EA_PLATFORM_CAPILANO) || (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_GAMES || WINAPI_FAMILY == WINAPI_FAMILY_TV_TITLE))
+#elif defined(EA_PLATFORM_XBOXONE) || defined(_DURANGO) || defined(_XBOX_ONE) || defined(EA_PLATFORM_CAPILANO) || defined(_GAMING_XBOX)
 	// XBox One
 	// Durango was Microsoft's code-name for the platform, which is now obsolete.
 	// Microsoft uses _DURANGO instead of some variation of _XBOX, though it's not natively defined by the compiler.
@@ -170,11 +170,11 @@
 	
 	#if defined(WINAPI_FAMILY) 
 		#include <winapifamily.h>
-		#if WINAPI_FAMILY == WINAPI_FAMILY_TV_TITLE
+		#if defined(WINAPI_FAMILY_TV_TITLE) && WINAPI_FAMILY == WINAPI_FAMILY_TV_TITLE
 			#define EA_WINAPI_FAMILY EA_WINAPI_FAMILY_TV_TITLE
-		#elif WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
+		#elif defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
 			#define EA_WINAPI_FAMILY EA_WINAPI_FAMILY_DESKTOP_APP
-		#elif WINAPI_FAMILY == WINAPI_FAMILY_GAMES
+		#elif defined(WINAPI_FAMILY_GAMES) && WINAPI_FAMILY == WINAPI_FAMILY_GAMES
 			#define EA_WINAPI_FAMILY EA_WINAPI_FAMILY_GAMES
 		#else
 			#error Unsupported WINAPI_FAMILY

+ 1 - 1
include/Common/EABase/eahave.h

@@ -592,7 +592,7 @@
 #endif
 
 #if !defined(EA_HAVE_nanosleep_DECL) && !defined(EA_NO_HAVE_nanosleep_DECL)
-	#if (defined(EA_PLATFORM_UNIX) && !defined(EA_PLATFORM_SONY)) || defined(EA_PLATFORM_IPHONE) || defined(EA_PLATFORM_OSX) || defined(EA_PLATFORM_PS4)
+	#if (defined(EA_PLATFORM_UNIX) && !defined(EA_PLATFORM_SONY)) || defined(EA_PLATFORM_IPHONE) || defined(EA_PLATFORM_OSX) || defined(EA_PLATFORM_PS4) || defined(CS_UNDEFINED_STRING)
 		#define EA_HAVE_nanosleep_DECL 1
 	#else
 		#define EA_NO_HAVE_nanosleep_DECL 1

+ 2 - 2
include/Common/EABase/version.h

@@ -29,8 +29,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifndef EABASE_VERSION
-    #define EABASE_VERSION "2.09.05"
-    #define EABASE_VERSION_N 20905
+    #define EABASE_VERSION "2.09.06"
+    #define EABASE_VERSION_N 20906
 #endif
 
 #endif