Browse Source

define renames and disabling alignas usage on AppleClang

Rob Parolin 6 years ago
parent
commit
fc7fb17713

+ 2 - 2
.gitignore

@@ -1,4 +1,4 @@
 tags
-/build/
+build
 build.bat
-build.sh
+

+ 5 - 10
include/Common/EABase/config/eacompiler.h

@@ -258,10 +258,6 @@
 			#define EA_COMPILER_CPP11_ENABLED 1
 		#elif defined(_MSC_VER) && _MSC_VER >= 1600         // Microsoft unilaterally enables its C++11 support; there is no way to disable it.
 			#define EA_COMPILER_CPP11_ENABLED 1
-		#elif defined(__SN_VER__) && (__SN_VER__ >= 43001)
-			#if __option(cpp11)
-				#define EA_COMPILER_CPP11_ENABLED 1
-			#endif
 		#elif defined(__EDG_VERSION__) // && ???
 			// To do: Is there a generic way to determine this?
 		#endif
@@ -1718,13 +1714,12 @@
 	// specifically to full C++11 thread_local support. The EAThread package provides a wrapper for 
 	// __thread via EA_THREAD_LOCAL (which unfortunately sounds like C++ thread_local). 
 	//
+	// https://en.cppreference.com/w/cpp/keyword/thread_local
+	//
 	#if !defined(EA_COMPILER_NO_THREAD_LOCAL)
-		// Not supported by VC++ as of VS2013, though all VC++ versions have partial support via __thread.
-
-		//#if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && __has_feature(cxx_thread_local) && _______
-		//    // thread_local requires a cooperating standard library, and we yet don't have a means to identify such a thing.
-
-		#if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900)     // VS2015+
+		#if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && EA_COMPILER_HAS_FEATURE(cxx_thread_local)
+			// supported.
+		#elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900)     // VS2015+
 			// supported.
 		#elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008)   // GCC 4.8+
 			// supported.

+ 10 - 9
include/Common/EABase/config/eacompilertraits.h

@@ -780,6 +780,7 @@
 
 			#define EA_DISABLE_CLANG_WARNING(w)   \
 				_Pragma("clang diagnostic push")  \
+				_Pragma(EACLANGWHELP2(-Wunknown-warning-option))\
 				_Pragma(EACLANGWHELP2(w))
 		#else
 			#define EA_DISABLE_CLANG_WARNING(w)
@@ -1524,7 +1525,7 @@
 			#else
 				#define EA_SSE 0
 			#endif
-		#elif (defined(EA_SSE3) && EA_SSE3) || defined EA_PLATFORM_CAPILANO
+		#elif (defined(EA_SSE3) && EA_SSE3) || defined EA_PLATFORM_XBOXONE
 			#define EA_SSE 3
 		#elif defined(EA_SSE2) && EA_SSE2
 			#define EA_SSE 2
@@ -1563,28 +1564,28 @@
 		#endif
 	#endif
 	#ifndef EA_SSSE3
-		#if defined __SSSE3__ || defined EA_PLATFORM_CAPILANO
+		#if defined __SSSE3__ || defined EA_PLATFORM_XBOXONE
 			#define EA_SSSE3 1
 		#else
 			#define EA_SSSE3 0
 		#endif
 	#endif
 	#ifndef EA_SSE4_1
-		#if defined __SSE4_1__ || defined EA_PLATFORM_CAPILANO
+		#if defined __SSE4_1__ || defined EA_PLATFORM_XBOXONE
 			#define EA_SSE4_1 1
 		#else
 			#define EA_SSE4_1 0
 		#endif
 	#endif
 	#ifndef EA_SSE4_2
-		#if defined __SSE4_2__ || defined EA_PLATFORM_CAPILANO
+		#if defined __SSE4_2__ || defined EA_PLATFORM_XBOXONE
 			#define EA_SSE4_2 1
 		#else
 			#define EA_SSE4_2 0
 		#endif
 	#endif
 	#ifndef EA_SSE4A
-		#if defined __SSE4A__ || defined EA_PLATFORM_CAPILANO
+		#if defined __SSE4A__ || defined EA_PLATFORM_XBOXONE
 			#define EA_SSE4A 1
 		#else
 			#define EA_SSE4A 0
@@ -1602,7 +1603,7 @@
 	#ifndef EA_AVX
 		#if defined __AVX2__
 			#define EA_AVX 2
-		#elif defined __AVX__ || defined EA_PLATFORM_CAPILANO
+		#elif defined __AVX__ || defined EA_PLATFORM_XBOXONE
 			#define EA_AVX 1
 		#else
 			#define EA_AVX 0
@@ -1619,7 +1620,7 @@
 	// EA_FP16C may be used to determine the existence of float <-> half conversion operations on an x86 CPU.
 	// (For example to determine if _mm_cvtph_ps or _mm_cvtps_ph could be used.)
 	#ifndef EA_FP16C
-		#if defined __F16C__ || defined EA_PLATFORM_CAPILANO
+		#if defined __F16C__ || defined EA_PLATFORM_XBOXONE
 			#define EA_FP16C 1
 		#else
 			#define EA_FP16C 0
@@ -1630,7 +1631,7 @@
 	// but has support by some implementations of clang (__FLOAT128__)
 	// PS4 does not support __float128 as of SDK 5.500 https://ps4.siedev.net/resources/documents/SDK/5.500/CPU_Compiler_ABI-Overview/0003.html
 	#ifndef EA_FP128
-		#if (defined __FLOAT128__ || defined _GLIBCXX_USE_FLOAT128) && !defined(EA_PLATFORM_KETTLE)
+		#if (defined __FLOAT128__ || defined _GLIBCXX_USE_FLOAT128) && !defined(EA_PLATFORM_PS4)
 			#define EA_FP128 1
 		#else
 			#define EA_FP128 0
@@ -1671,7 +1672,7 @@
 	#ifndef EA_BMI
 		#if defined(__BMI2__)
 			#define EA_BMI 2
-		#elif defined(__BMI__) || defined(EA_PLATFORM_CAPILANO)
+		#elif defined(__BMI__) || defined(EA_PLATFORM_XBOXONE)
 			#define EA_BMI 1
 		#else
 			#define EA_BMI 0

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

@@ -34,7 +34,7 @@
 // not standards-compliant in this respect, so we need an additional include.
 // The case is similar with wchar_t under C++.
 
-#if defined(EA_COMPILER_GNUC) || defined(EA_COMPILER_MSVC) || defined(EA_WCHAR_T_NON_NATIVE) || defined(EA_PLATFORM_KETTLE)
+#if defined(EA_COMPILER_GNUC) || defined(EA_COMPILER_MSVC) || defined(EA_WCHAR_T_NON_NATIVE) || defined(EA_PLATFORM_PS4)
 	#if defined(EA_COMPILER_MSVC)
 		#pragma warning(push, 0)
 		#pragma warning(disable: 4265 4365 4836 4574)

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

@@ -234,7 +234,7 @@
 
 // #include <sys/signal.h>
 #if !defined(EA_HAVE_SYS_SIGNAL_H) && !defined(EA_NO_HAVE_SYS_SIGNAL_H)
-	#if defined(EA_PLATFORM_BSD) || defined(EA_PLATFORM_KETTLE)
+	#if defined(EA_PLATFORM_BSD) || defined(EA_PLATFORM_PS4)
 		#define EA_HAVE_SYS_SIGNAL_H 1
 	#else
 		#define EA_NO_HAVE_SYS_SIGNAL_H 1
@@ -270,7 +270,7 @@
 
 // #include <alloca.h>
 #if !defined(EA_HAVE_ALLOCA_H) && !defined(EA_NO_HAVE_ALLOCA_H)
-	#if !defined(EA_HAVE_MALLOC_H) && !defined(EA_PLATFORM_KETTLE)
+	#if !defined(EA_HAVE_MALLOC_H) && !defined(EA_PLATFORM_PS4)
 		#define EA_HAVE_ALLOCA_H 1
 	#else
 		#define EA_NO_HAVE_ALLOCA_H 1
@@ -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_KETTLE)
+	#if (defined(EA_PLATFORM_UNIX) && !defined(EA_PLATFORM_SONY)) || defined(EA_PLATFORM_IPHONE) || defined(EA_PLATFORM_OSX) || defined(EA_PLATFORM_PS4)
 		#define EA_HAVE_nanosleep_DECL 1
 	#else
 		#define EA_NO_HAVE_nanosleep_DECL 1

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

@@ -22,7 +22,7 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////////
 // EA_INT128_ALIGNAS
 //
-#if EA_INT128_INTRINSIC_AVAILABLE
+#if EA_INT128_INTRINSIC_AVAILABLE && !defined(EA_COMPILER_NO_ALIGNAS)
 	#define EA_INT128_ALIGNAS alignas(unsigned __int128)
 #else
 	#define EA_INT128_ALIGNAS

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

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

+ 1 - 1
test/source/TestEABase.cpp

@@ -1805,7 +1805,7 @@ int TestEACompiler()
 
 
 	// Test EA_COMPILER_NO_NORETURN / EA_NORETURN
-	#if !defined(EA_COMPILER_NO_NORETURN) && !defined(EA_PLATFORM_KETTLE) // Kettle SDK up to at least v.915 has a broken definition of the exit() function and fails to compile the valid code below.
+	#if !defined(EA_COMPILER_NO_NORETURN) && !defined(EA_PLATFORM_PS4) // Kettle SDK up to at least v.915 has a broken definition of the exit() function and fails to compile the valid code below.
 	{
 		struct NoReturnTest
 		{

+ 0 - 2
test/source/TestEABaseC.c

@@ -210,9 +210,7 @@ struct InitPriorityTestClass
 
 
 // EA_MAY_ALIAS
-#ifndef __SNC__ // SNC doesn't support this usage.
 void* EA_MAY_ALIAS gPtr0 = NULL;
-#endif
 
 typedef void* EA_MAY_ALIAS pvoid_may_alias;
 pvoid_may_alias gPtr1 = NULL;