rendercheck: rendercheck.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jan 31 05:03:25 UTC 2021


 rendercheck.h |   27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

New commits:
commit aa5dc7168c4cdef955e074dd7dbea495bffa64e6
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Jan 30 20:59:31 2021 -0800

    darwin: Build fix
    
    Fixes: f0e123add7e8023c6715ce483f94ace2d9a2dc72
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/rendercheck.h b/rendercheck.h
index 89db20d..46b1e83 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -105,9 +105,19 @@ struct rendercheck_test {
 	struct rendercheck_test_result (*func)(Display *dpy);
 };
 
-#define DECLARE_RENDERCHECK_TEST(name)		  \
+#ifdef __MACH__
+#define SECTION(X) section("__DATA,__" X )
+#define SECTION_START(X) __asm("section$start$__DATA$__" X)
+#define SECTION_END(X) __asm("section$end$__DATA$__" X)
+#else
+#define SECTION(X) section(X)
+#define SECTION_START(X)
+#define SECTION_END(X)
+#endif
+
+#define DECLARE_RENDERCHECK_TEST(name)             \
 	const struct rendercheck_test test_desc_##name \
-	__attribute__ ((section ("test_section")))
+	__attribute__ ((SECTION ("test_section")))
 
 #define DECLARE_RENDERCHECK_ARG_TEST(arg_name_, long_name_, func_)		\
 	DECLARE_RENDERCHECK_TEST(arg_name_) = {				\
@@ -117,6 +127,13 @@ struct rendercheck_test {
 		.func = func_,						\
 	}
 
+/* Storage that will point at the start and end of the ELF/MACH-O section for test
+ * structs.  These are automatically set up by the linker when placing things
+ * in their sections.
+ */
+extern struct rendercheck_test __start_test_section SECTION_START("test_section");
+extern struct rendercheck_test __stop_test_section SECTION_END("test_section");
+
 struct render_format {
 	XRenderPictFormat *format;
 	char *name;
@@ -125,12 +142,6 @@ struct render_format {
 extern struct render_format *formats;
 extern int nformats;
 
-/* Storage that will point at the start and end of the ELF section for test
- * structs.  These are automatically set up by the linker when placing things
- * in their sections.
- */
-extern struct rendercheck_test __start_test_section, __stop_test_section;
-
 extern int pixmap_move_iter;
 extern int win_width, win_height;
 extern struct op_info ops[];


More information about the xorg-commit mailing list