Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_WaylandUtils.h')
-rw-r--r--intern/ghost/intern/GHOST_WaylandUtils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WaylandUtils.h b/intern/ghost/intern/GHOST_WaylandUtils.h
new file mode 100644
index 00000000000..0e1e133bc4c
--- /dev/null
+++ b/intern/ghost/intern/GHOST_WaylandUtils.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/** \file
+ * \ingroup GHOST
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+# undef wl_array_for_each
+/**
+ * This macro causes a warning for C++ code, define our own.
+ * See: https://gitlab.freedesktop.org/wayland/wayland/-/issues/34
+ */
+# define WL_ARRAY_FOR_EACH(pos, array) \
+ for (pos = (decltype(pos))((array)->data); \
+ (const char *)pos < ((const char *)(array)->data + (array)->size); \
+ (pos)++)
+#endif