commit 5120f4f
Michael Forney
·
2013-11-25 10:14:47 +0000 UTC
parent 375e441
Drop internal.h
3 files changed,
+2,
-62
+0,
-60
1@@ -1,60 +0,0 @@
2-/* swc: swc/internal.h
3- *
4- * Copyright (c) 2013 Michael Forney
5- *
6- * Permission is hereby granted, free of charge, to any person obtaining a copy
7- * of this software and associated documentation files (the "Software"), to deal
8- * in the Software without restriction, including without limitation the rights
9- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10- * copies of the Software, and to permit persons to whom the Software is
11- * furnished to do so, subject to the following conditions:
12- *
13- * The above copyright notice and this permission notice shall be included in
14- * all copies or substantial portions of the Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22- * SOFTWARE.
23- */
24-
25-#ifndef SWC_INTERNAL_H
26-#define SWC_INTERNAL_H
27-
28-#include "util.h"
29-
30-#define INTERNAL_ASSOCIATIONS(ptr, base) \
31- INTERNAL_ASSOCIATION(window, ptr, \
32- base)
33-
34-#if defined(__has_feature)
35-# define HAVE_GENERIC __has_extension(c_generic_selections)
36-/* GCC doesn't have _Generic support, even with -std=c11 */
37-#elif __STDC_VERSION >= 201112L && !defined(__GNUC__)
38-# define HAVE_GENERIC 1
39-#else
40-# define HAVE_GENERIC 0
41-#endif
42-
43-#if HAVE_GENERIC
44-# define INTERNAL_ASSOCIATION(type, ptr, next) \
45- struct swc_ ## type *: \
46- (struct swc_ ## type ## _internal *) ptr \
47- next
48-# define INTERNAL(ptr) \
49- _Generic(ptr, INTERNAL_ASSOCIATIONS(ptr,))
50-#else
51-/* If we don't have _Generic, emulate it with __builtin_choose_expr. */
52-# define INTERNAL_ASSOCIATION(type, ptr, next) \
53- __builtin_choose_expr( \
54- __builtin_types_compatible_p(typeof(ptr), struct swc_ ## type *), \
55- (struct swc_ ## type ## _internal *) ptr, next)
56-# define INTERNAL(ptr) \
57- INTERNAL_ASSOCIATIONS(ptr, (void) 0)
58-#endif
59-
60-#endif
61-
+0,
-1
1@@ -23,7 +23,6 @@
2
3 #include "swc.h"
4 #include "compositor_surface.h"
5-#include "internal.h"
6 #include "shell_surface.h"
7 #include "window.h"
8
+2,
-1
1@@ -24,13 +24,14 @@
2 #include "window.h"
3 #include "compositor.h"
4 #include "compositor_surface.h"
5-#include "internal.h"
6 #include "private.h"
7 #include "swc.h"
8
9 #include <stdlib.h>
10 #include <string.h>
11
12+#define INTERNAL(window) ((struct swc_window_internal *) (window))
13+
14 static void handle_window_enter(struct wl_listener * listener, void * data)
15 {
16 struct swc_event * event = data;