mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-17 07:00:20 +01:00
In the C23 standard unreachable() is now a predefined function-like macro in <stddef.h> See https://android.googlesource.com/platform/bionic/+/HEAD/docs/c23.md#is-now-a-predefined-function_like-macro-in And this causes build errors when building for C23: ----------------------------------------------------------------------- In file included from ../src/util/log.h:30, from ../src/util/log.c:30: ../src/util/macros.h:123:9: warning: "unreachable" redefined 123 | #define unreachable(str) \ | ^~~~~~~~~~~ In file included from ../src/util/macros.h:31: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:456:9: note: this is the location of the previous definition 456 | #define unreachable() (__builtin_unreachable ()) | ^~~~~~~~~~~ ----------------------------------------------------------------------- So don't redefine it with the same name, but use the name UNREACHABLE() to also signify it's a macro. Using a different name also makes sense because the behavior of the macro was extending the one of __builtin_unreachable() anyway, and it also had a different signature, accepting one argument, compared to the standard unreachable() with no arguments. This change improves the chances of building mesa with the C23 standard, which for instance is the default in recent AOSP versions. All the instances of the macro, including the definition, were updated with the following command line: git grep -l '[^_]unreachable(' -- "src/**" | sort | uniq | \ while read file; \ do \ sed -e 's/\([^_]\)unreachable(/\1UNREACHABLE(/g' -i "$file"; \ done && \ sed -e 's/#undef unreachable/#undef UNREACHABLE/g' -i src/intel/isl/isl_aux_info.c Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437> |
||
|---|---|---|
| .. | ||
| tests | ||
| formats.c | ||
| layout.c | ||
| layout.h | ||
| meson.build | ||
| README | ||
| tiling.cc | ||
# ail ail is a small library for working with the image (and buffer) layouts encountered with AGX hardware. Its design is inspired by isl. In particular, ail strives to use isl unit suffixes and to represent quantities in a canonical, API-agnostic fashion. ail conventions differ slightly from isl. See the isl documentation in mesa/docs/isl for the conventions that inspired ail, in particular mesa/docs/isl/units.rst. In ail, we have the following units: **Bytes (B)**: 8-bits. **Samples (sa)**: An individual sample. The number of bytes per sample depends on the format. **Pixels (px)**: The unit everything starts as from the API. A pixel contains a fixed number of samples, given as the layout's `sample_count_sa`. For twiddled layouts, these samples are stored together in emmory. **Elements (el)**: For a block-compressed format, a single compression block containing multiple pixels. Otherwise, equal to a single pixel. **Tiles (tiles)**: Defined only for tiled/twiddled layouts. A group of elements forming the layout-specific tile. We do not support any multisampled block-compressed layouts, so either pixels equals either samples or elements.