diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2021-01-30 20:59:31 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2021-01-30 20:59:42 -0800 |
commit | aa5dc7168c4cdef955e074dd7dbea495bffa64e6 (patch) | |
tree | 9cae5f794ddcfefe9ace374170ea1001a9adcac9 | |
parent | c0ab77ba31ed63f525dd4ecf80529bd8b790f3a9 (diff) |
darwin: Build fix
Fixes: f0e123add7e8023c6715ce483f94ace2d9a2dc72
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r-- | rendercheck.h | 27 |
1 files changed, 19 insertions, 8 deletions
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[]; |