[PATCH weston 3/8] gl-renderer: only use sync-file on Linux

Greg V greg at unrelenting.technology
Sun Dec 17 19:04:37 UTC 2017


If no sync_file header was found, only assume this functionality exists
when on Linux.
---
 libweston/gl-renderer.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index abf556f0..62e95c3f 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -44,7 +44,7 @@
 
 #ifdef HAVE_LINUX_SYNC_FILE_H
 #include <linux/sync_file.h>
-#else
+#elif __linux__
 #include "weston-sync-file.h"
 #endif
 
@@ -302,6 +302,7 @@ get_renderer(struct weston_compositor *ec)
 	return (struct gl_renderer *)ec->renderer;
 }
 
+#if defined(HAVE_LINUX_SYNC_FILE_H) || defined(__linux__)
 static int
 linux_sync_file_read_timestamp(int fd, uint64_t *ts)
 {
@@ -320,6 +321,13 @@ linux_sync_file_read_timestamp(int fd, uint64_t *ts)
 
 	return 0;
 }
+#else
+static int
+linux_sync_file_read_timestamp(int fd __attribute__((unused)), uint64_t *ts __attribute__((unused)))
+{
+	return -1;
+}
+#endif
 
 static void
 timeline_render_point_destroy(struct timeline_render_point *trp)
-- 
2.15.1



More information about the wayland-devel mailing list