Mesa (main): util: add missing c99_compat.h includes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 2 13:50:04 UTC 2022


Module: Mesa
Branch: main
Commit: 9ec514ded7c38556f5101df021d042405fe1dad9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ec514ded7c38556f5101df021d042405fe1dad9

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Jun  1 14:04:53 2022 +0200

util: add missing c99_compat.h includes

These headers use the "restrict" keyword, so they need to include
c99_compat.h in case they get included from C++.

Right now, we include c99_compat.h in many needless places, which saves
us. But we're about to stop doing that.

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>

---

 src/util/format/u_format.h        | 2 ++
 src/util/format/u_format_bptc.h   | 2 ++
 src/util/format/u_format_etc.h    | 2 ++
 src/util/format/u_format_fxt1.h   | 2 ++
 src/util/format/u_format_latc.h   | 2 ++
 src/util/format/u_format_other.h  | 1 +
 src/util/format/u_format_rgtc.h   | 2 ++
 src/util/format/u_format_s3tc.h   | 2 ++
 src/util/format/u_format_yuv.h    | 1 +
 src/util/format/u_format_zs.h     | 2 ++
 src/util/indices/u_indices_gen.py | 1 +
 src/util/u_math.h                 | 1 +
 12 files changed, 20 insertions(+)

diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h
index 5b5026bd242..56cb7a70b97 100644
--- a/src/util/format/u_format.h
+++ b/src/util/format/u_format.h
@@ -34,6 +34,8 @@
 #include "pipe/p_defines.h"
 #include "util/u_debug.h"
 
+#include "c99_compat.h"
+
 union pipe_color_union;
 struct pipe_screen;
 
diff --git a/src/util/format/u_format_bptc.h b/src/util/format/u_format_bptc.h
index cff18c01ef4..5dda6366b1a 100644
--- a/src/util/format/u_format_bptc.h
+++ b/src/util/format/u_format_bptc.h
@@ -32,6 +32,8 @@
 
 #include "pipe/p_compiler.h"
 
+#include "c99_compat.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/util/format/u_format_etc.h b/src/util/format/u_format_etc.h
index 49c6ac17531..536ad1d7fb9 100644
--- a/src/util/format/u_format_etc.h
+++ b/src/util/format/u_format_etc.h
@@ -28,6 +28,8 @@
 #ifndef U_FORMAT_ETC1_H_
 #define U_FORMAT_ETC1_H_
 
+#include "c99_compat.h"
+
 void
 util_format_etc1_rgb8_unpack_rgba_8unorm(uint8_t *restrict dst_row, unsigned dst_stride, const uint8_t *restrict src_row, unsigned src_stride, unsigned width, unsigned height);
 
diff --git a/src/util/format/u_format_fxt1.h b/src/util/format/u_format_fxt1.h
index 2b8cea25b94..a9a8feb3d88 100644
--- a/src/util/format/u_format_fxt1.h
+++ b/src/util/format/u_format_fxt1.h
@@ -32,6 +32,8 @@
 
 #include "pipe/p_compiler.h"
 
+#include "c99_compat.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/util/format/u_format_latc.h b/src/util/format/u_format_latc.h
index db267daff46..6fd6475625a 100644
--- a/src/util/format/u_format_latc.h
+++ b/src/util/format/u_format_latc.h
@@ -28,6 +28,8 @@
 #ifndef U_FORMAT_LATC_H_
 #define U_FORMAT_LATC_H_
 
+#include "c99_compat.h"
+
 void
 util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *restrict dst, const uint8_t *restrict src, unsigned i, unsigned j);
 
diff --git a/src/util/format/u_format_other.h b/src/util/format/u_format_other.h
index 3547e9e673f..21095be3921 100644
--- a/src/util/format/u_format_other.h
+++ b/src/util/format/u_format_other.h
@@ -32,6 +32,7 @@
 
 #include "pipe/p_compiler.h"
 
+#include "c99_compat.h"
 
 void
 util_format_r9g9b9e5_float_unpack_rgba_float(void *restrict dst_row,
diff --git a/src/util/format/u_format_rgtc.h b/src/util/format/u_format_rgtc.h
index 44ddfa9fdea..c79e0197bae 100644
--- a/src/util/format/u_format_rgtc.h
+++ b/src/util/format/u_format_rgtc.h
@@ -28,6 +28,8 @@
 #ifndef U_FORMAT_RGTC_H_
 #define U_FORMAT_RGTC_H_
 
+#include "c99_compat.h"
+
 void
 util_format_rgtc1_unorm_fetch_rgba_8unorm(uint8_t *restrict dst, const uint8_t *restrict src, unsigned i, unsigned j);
 
diff --git a/src/util/format/u_format_s3tc.h b/src/util/format/u_format_s3tc.h
index 0487f1e0d82..61b039cc74d 100644
--- a/src/util/format/u_format_s3tc.h
+++ b/src/util/format/u_format_s3tc.h
@@ -32,6 +32,8 @@
 
 #include "pipe/p_compiler.h"
 
+#include "c99_compat.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/util/format/u_format_yuv.h b/src/util/format/u_format_yuv.h
index 30dc86f25cb..afa4a3a61e9 100644
--- a/src/util/format/u_format_yuv.h
+++ b/src/util/format/u_format_yuv.h
@@ -48,6 +48,7 @@
 #include "pipe/p_compiler.h"
 #include "util/u_math.h"
 
+#include "c99_compat.h"
 
 /*
  * TODO: Ensure we use consistent and right floating formulas, with enough
diff --git a/src/util/format/u_format_zs.h b/src/util/format/u_format_zs.h
index 91f95f59eba..107cce8e2ea 100644
--- a/src/util/format/u_format_zs.h
+++ b/src/util/format/u_format_zs.h
@@ -32,6 +32,8 @@
 
 #include "pipe/p_compiler.h"
 
+#include "c99_compat.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/util/indices/u_indices_gen.py b/src/util/indices/u_indices_gen.py
index 5f8f6ab110c..ec3c3ea7f88 100644
--- a/src/util/indices/u_indices_gen.py
+++ b/src/util/indices/u_indices_gen.py
@@ -82,6 +82,7 @@ def prolog():
 #include "util/u_debug.h"
 #include "util/u_memory.h"
 
+#include "c99_compat.h"
 
 static unsigned out_size_idx( unsigned index_size )
 {
diff --git a/src/util/u_math.h b/src/util/u_math.h
index d3a062f9e11..5ceb19010a9 100644
--- a/src/util/u_math.h
+++ b/src/util/u_math.h
@@ -39,6 +39,7 @@
 #define U_MATH_H
 
 
+#include "c99_compat.h"
 #include "c99_math.h"
 #include <assert.h>
 #include <float.h>



More information about the mesa-commit mailing list