40#ifndef INCLUDED_GLS_CPP_LANG_SUPPORT_H
41#define INCLUDED_GLS_CPP_LANG_SUPPORT_H
73#if defined( _MSC_VER )
75# define DISTI_HAS_RVAL_REFS
76# define DISTI_HAS_METHOD_OVERRIDE
77# define DISTI_HAS_TYPE_TRAITS
78# define DISTI_HAS_STATIC_ASSERT
81# define DISTI_HAS_SPECIAL_MEM_FUN_DEL
82# define DISTI_HAS_CPP11
85# define DISTI_HAS_USER_DEFINED_LITERALS
87# if _MSC_VER >= 1911 && __cplusplus >= 201402L
88# define DISTI_HAS_NOEXCEPT
89# define DISTI_HAS_DEPRECATED_ATTRIBUTE
90# define DISTI_HAS_CPP14
96#elif defined( __GNUC__ ) && !defined( __clang__ )
98# if __cpp_rvalue_references >= 200610 || ( ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3 ) ) && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || __cplusplus >= 201103L ) )
99# define DISTI_HAS_RVAL_REFS
101# if __cpp_static_assert >= 200410 && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || __cplusplus >= 201103L )
102# define DISTI_HAS_STATIC_ASSERT
104# if( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 9 ) ) && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || __cplusplus >= 201103L )
105# define DISTI_HAS_USER_DEFINED_LITERALS
107# if( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) ) && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || __cplusplus >= 201103L )
108# define DISTI_HAS_METHOD_OVERRIDE
109# define DISTI_HAS_NOEXCEPT
110# define DISTI_HAS_TYPE_TRAITS
111# define DISTI_HAS_CPP11
113# if( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) ) && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || __cplusplus >= 201103L )
114# define DISTI_HAS_SPECIAL_MEM_FUN_DEL
116# if( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 9 ) ) && __cplusplus >= 201402L
117# define DISTI_HAS_DEPRECATED_ATTRIBUTE
118# define DISTI_HAS_CPP14
124#elif defined( __clang__ )
125# if __has_feature( cxx_rvalue_references )
126# define DISTI_HAS_RVAL_REFS
127# define DISTI_HAS_CPP11
129# if __has_feature( cxx_override_control )
130# define DISTI_HAS_METHOD_OVERRIDE
132# if __has_feature( cxx_noexcept )
133# define DISTI_HAS_NOEXCEPT
135# if __has_feature( cxx_defaulted_functions ) && __has_feature( cxx_deleted_functions )
136# define DISTI_HAS_SPECIAL_MEM_FUN_DEL
138# if __has_feature( cxx_static_assert )
139# define DISTI_HAS_STATIC_ASSERT
141# if __has_feature( cxx_user_literals )
142# define DISTI_HAS_USER_DEFINED_LITERALS
144# if( __clang_major__ > 3 || ( __clang_major__ == 3 && __clang_minor__ >= 4 ) ) && __cplusplus >= 201402L
145# define DISTI_HAS_DEPRECATED_ATTRIBUTE
146# define DISTI_HAS_CPP14
149# define DISTI_HAS_TYPE_TRAITS
157#ifdef DISTI_HAS_CPP14
159# define DISTI_HAS_CPP11
161# define DISTI_HAS_DEPRECATED_ATTRIBUTE
164#ifdef DISTI_HAS_CPP11
166# define DISTI_IF_HAS_CPP11( x ) x
168# define DISTI_IF_HAS_CPP11_ELSE( x, y ) x
171# define DISTI_HAS_RVAL_REFS
173# define DISTI_HAS_METHOD_OVERRIDE
175# define DISTI_HAS_SPECIAL_MEM_FUN_DEL
177# define DISTI_HAS_TYPE_TRAITS
179# define DISTI_HAS_STATIC_ASSERT
183# define DISTI_IF_HAS_CPP11( x )
184# define DISTI_IF_HAS_CPP11_ELSE( x, y ) y
190#if !defined( DISTI_NO_RVAL_REFS ) && defined( DISTI_HAS_RVAL_REFS )
193# define DISTI_RVAL_MOVE( x ) std::move( x )
195# define DISTI_UREF_FORWARD( T, x ) std::forward<T>( x )
197# define DISTI_UREF( T ) T&&
199# define DISTI_IF_HAS_RVAL_REFS( x ) x
201# define DISTI_IF_HAS_RVAL_REFS_ELSE( x, y ) x
203# undef DISTI_HAS_RVAL_REFS
204# define DISTI_RVAL_MOVE( x ) x
205# define DISTI_UREF_FORWARD( T, x ) x
206# define DISTI_UREF( T ) const T&
207# define DISTI_IF_HAS_RVAL_REFS( x )
208# define DISTI_IF_HAS_RVAL_REFS_ELSE( x, y ) y
212#if !defined( DISTI_NO_METHOD_OVERRIDE ) && defined( DISTI_HAS_METHOD_OVERRIDE )
214# define DISTI_METHOD_OVERRIDE override
216# define DISTI_FINAL final
218# undef DISTI_HAS_METHOD_OVERRIDE
219# define DISTI_METHOD_OVERRIDE
224#if !defined( DISTI_NO_NOEXCEPT ) && defined( DISTI_HAS_NOEXCEPT )
225# define DISTI_FUNC_NOEXCEPT noexcept
227# undef DISTI_HAS_NOEXCEPT
229# define DISTI_FUNC_NOEXCEPT
233#if !defined( DISTI_NO_SPECIAL_MEM_FUN_DEL ) && defined( DISTI_HAS_SPECIAL_MEM_FUN_DEL )
235# define DISTI_SPECIAL_MEM_FUN_DELETE = delete
237# undef DISTI_HAS_SPECIAL_MEM_FUN_DEL
238# define DISTI_SPECIAL_MEM_FUN_DELETE
242#if !defined( DISTI_NO_USER_DEFINED_LITERALS ) && defined( DISTI_HAS_USER_DEFINED_LITERALS )
243# define DISTI_IF_HAS_USER_DEFINED_LITERAL( x ) x
245# undef DISTI_HAS_USER_DEFINED_LITERALS
247# define DISTI_IF_HAS_USER_DEFINED_LITERAL( x )
251#if !defined( DISTI_NO_TYPE_TRAITS ) && defined( DISTI_HAS_TYPE_TRAITS )
256# define DISTI_IF_HAS_TYPE_TRAITS_ELSE( x, y ) x
264# define DISTI_STATIC_ASSERT_IS_CONVERTIBLE_TO( T, ConvertsTo ) DISTI_STATIC_ASSERT( ( std::is_convertible<T*, ConvertsTo*>::value ), class_does_not_inherit_from_##ConvertsTo );
267# define DISTI_IS_TRIVIALLY_DESTRUCTIBLE( T ) ( std::is_trivially_destructible<T>() )
269# define DISTI_TT_TRUE_TYPE std::true_type
271# define DISTI_TT_FALSE_TYPE std::false_type
273# undef DISTI_HAS_TYPE_TRAITS
274# define DISTI_IF_HAS_TYPE_TRAITS_ELSE( x, y ) y
277# define DISTI_STATIC_ASSERT_IS_CONVERTIBLE_TO( T, ConvertsTo ) DISTI_STATIC_ASSERT( ( ::disti::_cppLangSupportDetail::is_convertible<T*, ConvertsTo*>::value ), class_does_not_inherit_from_##ConvertsTo )
280# define DISTI_IS_TRIVIALLY_DESTRUCTIBLE( T ) ( ::disti::_cppLangSupportDetail::is_trivially_destructible<T>() )
281# define DISTI_TT_TRUE_TYPE ::disti::_cppLangSupportDetail::true_type
282# define DISTI_TT_FALSE_TYPE ::disti::_cppLangSupportDetail::false_type
288namespace _cppLangSupportDetail
304 template<
class T,
class U>
305 struct is_convertible
313 static Big Test( ... );
314 static Small Test( U );
320 value =
sizeof( Small ) ==
sizeof( ( Test( MakeT() ) ) )
325 template<
class T>
struct is_convertible<T, T > {
enum { value =
true }; };
326 template<
class T>
struct is_convertible<void, T > {
enum { value =
false }; };
327 template<
class T>
struct is_convertible<T, void> {
enum { value =
false }; };
328 template<>
struct is_convertible<void, void> {
enum { value =
true }; };
330# if defined( DISTI_USER_DEFINED_IS_TRIVIALLY_DESTRUCTIBLE )
331# define DISTI_TT_IS_TRIVIALLY_DESTRUCTIBLE( T ) ( DISTI_USER_DEFINED_IS_TRIVIALLY_DESTRUCTIBLE( T ) )
335# if defined( _MSC_VER )
336# define DISTI_TT_IS_TRIVIALLY_DESTRUCTIBLE( T ) ( __has_trivial_destructor( T ) || ( __is_pod( T ) && __has_trivial_constructor( T ) ) )
340# define DISTI_TT_IS_TRIVIALLY_DESTRUCTIBLE( T ) ( __has_trivial_destructor( T ) )
343# if defined( DISTI_USER_DEFINED_IS_DESTRUCTIBLE )
344# define DISTI_TT_IS_DESTRUCTIBLE( T ) ( DISTI_USER_DEFINED_IS_DESTRUCTIBLE( T ) )
348# define DISTI_TT_IS_DESTRUCTIBLE( T ) ( __is_pod( T ) || __is_class( T ) )
352 template<
typename T, T Val>
353 struct integral_constant
355 static const T value;
356 typedef T value_type;
357 typedef integral_constant<T, Val> type;
358 operator value_type() {
return value; }
361 template<
typename T, T Val>
362 const T integral_constant<T, Val>::value = Val;
364 typedef integral_constant<bool, true> true_type;
365 typedef integral_constant<bool, false> false_type;
368 struct is_trivially_destructible
369 : integral_constant<bool, DISTI_TT_IS_DESTRUCTIBLE( T ) && DISTI_TT_IS_TRIVIALLY_DESTRUCTIBLE( T )>
377#if defined( DISTI_NO_STATIC_ASSERT )
378# undef DISTI_HAS_STATIC_ASSERT
379# define DISTI_STATIC_ASSERT( expr, msg )
382# define DISTI_PREPROC_STRINGIFY_HELPER( s ) # s
384# define DISTI_PREPROC_STRINGIFY( s ) DISTI_PREPROC_STRINGIFY_HELPER( s )
386# if defined( DISTI_HAS_STATIC_ASSERT )
396# define DISTI_STATIC_ASSERT( expr, msg ) static_assert( expr, DISTI_PREPROC_STRINGIFY( msg ) )
405# define DISTI_STATIC_ASSERT_STR( expr, msg ) static_assert( expr, msg )
410namespace _cppLangSupportDetail
415 struct CompileTimeError;
417 struct CompileTimeError<true>
419 CompileTimeError() {}
420 CompileTimeError(
const char* ) {}
435# define DISTI_STATIC_ASSERT( expr, msg ) \
437 ::disti::_cppLangSupportDetail::CompileTimeError<( ( expr ) != 0 )> ERROR_##msg; \
447# define DISTI_STATIC_ASSERT_STR( expr, msg ) \
449 ::disti::_cppLangSupportDetail::CompileTimeError<( ( expr ) != 0 )> ERROR_##__LINE__( msg ); \
450 (void)ERROR_##__LINE__; \
456#if defined( DISTI_HAS_DEPRECATED_ATTRIBUTE ) && !defined( DISTI_NO_DEPRECATED_ATTRIBUTE )
457# define DISTI_DEPRECATED( msg ) [[deprecated( msg )]]
459# define DISTI_DEPRECATED( msg )
470template<>
struct MaxDigits10<float> {
static const unsigned long value = 2 + (FLT_MANT_DIG * 30103UL) / 100000UL; };
472template<>
struct MaxDigits10<double> {
static const unsigned long value = 2 + (DBL_MANT_DIG * 30103UL) / 100000UL; };
474template<>
struct MaxDigits10<long double> {
static const unsigned long value = 2 + (LDBL_MANT_DIG * 30103UL) / 100000UL; };
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
Definition: gls_cpp_lang_support.h:468
static const unsigned long value
Definition: gls_cpp_lang_support.h:468