From 40b37b70874d45381d38a3f9dfdfb9a81d333e2e Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 27 Aug 2020 12:31:20 +0000 Subject: drop local workarounds for gcc 4.2 --- lib/mesa/include/c11_compat.h | 9 --------- lib/mesa/src/compiler/glsl/ast.h | 2 +- lib/mesa/src/util/ralloc.h | 12 ++++++------ 3 files changed, 7 insertions(+), 16 deletions(-) (limited to 'lib/mesa') diff --git a/lib/mesa/include/c11_compat.h b/lib/mesa/include/c11_compat.h index 76b2ae554..d35740f47 100644 --- a/lib/mesa/include/c11_compat.h +++ b/lib/mesa/include/c11_compat.h @@ -12,22 +12,13 @@ /* Already C11 */ #else -#ifndef __has_extension -#define __has_extension(x) 0 -#endif /* * C11 static_assert() macro * assert.h only defines that name for C11 and above */ #ifndef static_assert -#if defined(__clang__) && __has_extension(c_static_assert) -#define static_assert _Static_assert -#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4)) #define static_assert _Static_assert -#else -#define static_assert(cond, mesg) struct _C11_COMPAT_H_static_assert_unused -#endif #endif diff --git a/lib/mesa/src/compiler/glsl/ast.h b/lib/mesa/src/compiler/glsl/ast.h index e77fe8f12..3a960c2ff 100644 --- a/lib/mesa/src/compiler/glsl/ast.h +++ b/lib/mesa/src/compiler/glsl/ast.h @@ -912,7 +912,7 @@ public: /* empty */ } - ast_type_specifier(const struct glsl_type *t) + ast_type_specifier(const glsl_type *t) : type(t), type_name(t->name), structure(NULL), array_specifier(NULL), default_precision(ast_precision_none) { diff --git a/lib/mesa/src/util/ralloc.h b/lib/mesa/src/util/ralloc.h index d7cbd6aef..857ca5f79 100644 --- a/lib/mesa/src/util/ralloc.h +++ b/lib/mesa/src/util/ralloc.h @@ -488,7 +488,7 @@ bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args); * * which is more idiomatic in C++ than calling ralloc. */ -#define DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(TYPE, ALLOC_FUNC, USE_DESTRUCTOR) \ +#define DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(TYPE, ALLOC_FUNC) \ private: \ static void _ralloc_destructor(void *p) \ { \ @@ -499,7 +499,7 @@ public: \ { \ void *p = ALLOC_FUNC(mem_ctx, size); \ assert(p != NULL); \ - if (USE_DESTRUCTOR && !HAS_TRIVIAL_DESTRUCTOR(TYPE)) \ + if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \ ralloc_set_destructor(p, _ralloc_destructor); \ return p; \ } \ @@ -516,16 +516,16 @@ public: \ } #define DECLARE_RALLOC_CXX_OPERATORS(type) \ - DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, ralloc_size, true) + DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, ralloc_size) #define DECLARE_RZALLOC_CXX_OPERATORS(type) \ - DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, rzalloc_size, true) + DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, rzalloc_size) #define DECLARE_LINEAR_ALLOC_CXX_OPERATORS(type) \ - DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_alloc_child, false) + DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_alloc_child) #define DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(type) \ - DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_zalloc_child, false) + DECLARE_ALLOC_CXX_OPERATORS_TEMPLATE(type, linear_zalloc_child) /** -- cgit v1.2.3