blob: b05b875abb595c47e41d05bb34bfd7373172da38 [file] [log] [blame]
Brad Bishop1d80a2e2019-11-15 16:35:03 -05001From e746f3bf7c8bb2f5dcf9e93edffc23b56eff12d0 Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Tue, 5 Nov 2019 09:09:50 -0600
4Subject: [PATCH] Move wl_priv_signal to wayland-server-private.h
5
6Including wayland-server-core.h in wayland-private.h is problematic
7because wayland-private.h is included by wayland-scanner which should be
8able to build against non-POSIX platforms (e.g. MinGW). The only reason
9that wayland-server-core.h was included in wayland-private.h was for the
10wl_private_signal definitions, so move those to a
11wayland-server-private.h file that can be included by both
12wayland-server.c and the tests.
13
14Upstream-Status: Accepted [e7d88f35eb89cf0cc77cbddd834cacc63683a9cc]
15Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
16---
17 Makefile.am | 3 +-
18 src/wayland-private.h | 22 +--------------
19 src/wayland-server-private.h | 53 ++++++++++++++++++++++++++++++++++++
20 src/wayland-server.c | 1 +
21 tests/newsignal-test.c | 2 +-
22 5 files changed, 58 insertions(+), 23 deletions(-)
23 create mode 100644 src/wayland-server-private.h
24
25diff --git a/Makefile.am b/Makefile.am
26index f47d055..026d981 100644
27--- a/Makefile.am
28+++ b/Makefile.am
29@@ -56,7 +56,8 @@ libwayland_private_la_SOURCES = \
30 src/connection.c \
31 src/wayland-os.c \
32 src/wayland-os.h \
33- src/wayland-private.h
34+ src/wayland-private.h \
35+ src/wayland-server-private.h
36
37 include_HEADERS = \
38 src/wayland-util.h \
39diff --git a/src/wayland-private.h b/src/wayland-private.h
40index 29516ec..dc7d12f 100644
41--- a/src/wayland-private.h
42+++ b/src/wayland-private.h
43@@ -31,11 +31,11 @@
44 #include <stdarg.h>
45 #include <stdlib.h>
46 #include <stdint.h>
47+#include <stdbool.h>
48
49 #define WL_HIDE_DEPRECATED 1
50
51 #include "wayland-util.h"
52-#include "wayland-server-core.h"
53
54 /* Invalid memory address */
55 #define WL_ARRAY_POISON_PTR (void *) 4
56@@ -236,26 +236,6 @@ zalloc(size_t s)
57 return calloc(1, s);
58 }
59
60-struct wl_priv_signal {
61- struct wl_list listener_list;
62- struct wl_list emit_list;
63-};
64-
65-void
66-wl_priv_signal_init(struct wl_priv_signal *signal);
67-
68-void
69-wl_priv_signal_add(struct wl_priv_signal *signal, struct wl_listener *listener);
70-
71-struct wl_listener *
72-wl_priv_signal_get(struct wl_priv_signal *signal, wl_notify_func_t notify);
73-
74-void
75-wl_priv_signal_emit(struct wl_priv_signal *signal, void *data);
76-
77-void
78-wl_priv_signal_final_emit(struct wl_priv_signal *signal, void *data);
79-
80 void
81 wl_connection_close_fds_in(struct wl_connection *connection, int max);
82
83diff --git a/src/wayland-server-private.h b/src/wayland-server-private.h
84new file mode 100644
85index 0000000..23fa458
86--- /dev/null
87+++ b/src/wayland-server-private.h
88@@ -0,0 +1,53 @@
89+/*
90+ * Copyright © 2008-2011 Kristian Høgsberg
91+ * Copyright © 2011 Intel Corporation
92+ * Copyright © 2013 Jason Ekstrand
93+ *
94+ * Permission is hereby granted, free of charge, to any person obtaining
95+ * a copy of this software and associated documentation files (the
96+ * "Software"), to deal in the Software without restriction, including
97+ * without limitation the rights to use, copy, modify, merge, publish,
98+ * distribute, sublicense, and/or sell copies of the Software, and to
99+ * permit persons to whom the Software is furnished to do so, subject to
100+ * the following conditions:
101+ *
102+ * The above copyright notice and this permission notice (including the
103+ * next paragraph) shall be included in all copies or substantial
104+ * portions of the Software.
105+ *
106+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
107+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
108+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
109+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
110+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
111+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
112+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
113+ * SOFTWARE.
114+ */
115+
116+#ifndef WAYLAND_SERVER_PRIVATE_H
117+#define WAYLAND_SERVER_PRIVATE_H
118+
119+#include "wayland-server-core.h"
120+
121+struct wl_priv_signal {
122+ struct wl_list listener_list;
123+ struct wl_list emit_list;
124+};
125+
126+void
127+wl_priv_signal_init(struct wl_priv_signal *signal);
128+
129+void
130+wl_priv_signal_add(struct wl_priv_signal *signal, struct wl_listener *listener);
131+
132+struct wl_listener *
133+wl_priv_signal_get(struct wl_priv_signal *signal, wl_notify_func_t notify);
134+
135+void
136+wl_priv_signal_emit(struct wl_priv_signal *signal, void *data);
137+
138+void
139+wl_priv_signal_final_emit(struct wl_priv_signal *signal, void *data);
140+
141+#endif
142diff --git a/src/wayland-server.c b/src/wayland-server.c
143index 19f6a76..d6f0206 100644
144--- a/src/wayland-server.c
145+++ b/src/wayland-server.c
146@@ -45,6 +45,7 @@
147
148 #include "wayland-util.h"
149 #include "wayland-private.h"
150+#include "wayland-server-private.h"
151 #include "wayland-server.h"
152 #include "wayland-os.h"
153
154diff --git a/tests/newsignal-test.c b/tests/newsignal-test.c
155index 47c429b..f3a7bd9 100644
156--- a/tests/newsignal-test.c
157+++ b/tests/newsignal-test.c
158@@ -26,7 +26,7 @@
159 #include <assert.h>
160
161 #include "test-runner.h"
162-#include "wayland-private.h"
163+#include "wayland-server-private.h"
164
165 static void
166 signal_notify(struct wl_listener *listener, void *data)