aboutsummaryrefslogtreecommitdiff
path: root/src/waffle/core/wcore_window.h
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2014-07-01 15:58:09 -0700
committerChad Versace <chad.versace@linux.intel.com>2014-07-03 16:45:36 -0700
commit675c809c68357a7af05a9d13d3a0e907d6ffda6a (patch)
treeb355ce22044a562f76a2dc13223681e5da96d342 /src/waffle/core/wcore_window.h
parentbc9c58e7539d1387fcc60555e645e0b90bcb81ae (diff)
downloadwaffle-675c809c68357a7af05a9d13d3a0e907d6ffda6a.tar.gz
core: Remove empty structs from core objects
Emil discovered that MSVC does rejects empty structs with the error message "C requires that a struct or union has at least one member". This patch removes all empty structs from the wcore objects, and replaces each with a pair of safe typecast functions that provide bidirectional casting waffle_OBJ <-> wcore_OBJ. Reported-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src/waffle/core/wcore_window.h')
-rw-r--r--src/waffle/core/wcore_window.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/waffle/core/wcore_window.h b/src/waffle/core/wcore_window.h
index fc82111..20a154b 100644
--- a/src/waffle/core/wcore_window.h
+++ b/src/waffle/core/wcore_window.h
@@ -32,17 +32,19 @@ struct wcore_window;
union waffle_native_window;
struct wcore_window {
- struct waffle_window {} wfl;
struct api_object api;
-
struct wcore_display *display;
};
-DEFINE_CONTAINER_CAST_FUNC(wcore_window,
- struct wcore_window,
- struct waffle_window,
- wfl)
+static inline struct waffle_window*
+waffle_window(struct wcore_window *win) {
+ return (struct waffle_window*) win;
+}
+static inline struct wcore_window*
+wcore_window(struct waffle_window *win) {
+ return (struct wcore_window*) win;
+}
static inline bool
wcore_window_init(struct wcore_window *self,