swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 5120f4fd42cc515844601233844b9f2b7ac17d85
parent 375e4414c9fab21b0421940708a6a0e64075a4b0
Author: Michael Forney <mforney@mforney.org>
Date:   Mon, 25 Nov 2013 02:14:47 -0800

Drop internal.h

Diffstat:
Dlibswc/internal.h | 60------------------------------------------------------------
Mlibswc/shell_surface.c | 1-
Mlibswc/window.c | 3++-
3 files changed, 2 insertions(+), 62 deletions(-)

diff --git a/libswc/internal.h b/libswc/internal.h @@ -1,60 +0,0 @@ -/* swc: swc/internal.h - * - * Copyright (c) 2013 Michael Forney - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef SWC_INTERNAL_H -#define SWC_INTERNAL_H - -#include "util.h" - -#define INTERNAL_ASSOCIATIONS(ptr, base) \ - INTERNAL_ASSOCIATION(window, ptr, \ - base) - -#if defined(__has_feature) -# define HAVE_GENERIC __has_extension(c_generic_selections) -/* GCC doesn't have _Generic support, even with -std=c11 */ -#elif __STDC_VERSION >= 201112L && !defined(__GNUC__) -# define HAVE_GENERIC 1 -#else -# define HAVE_GENERIC 0 -#endif - -#if HAVE_GENERIC -# define INTERNAL_ASSOCIATION(type, ptr, next) \ - struct swc_ ## type *: \ - (struct swc_ ## type ## _internal *) ptr \ - next -# define INTERNAL(ptr) \ - _Generic(ptr, INTERNAL_ASSOCIATIONS(ptr,)) -#else -/* If we don't have _Generic, emulate it with __builtin_choose_expr. */ -# define INTERNAL_ASSOCIATION(type, ptr, next) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(typeof(ptr), struct swc_ ## type *), \ - (struct swc_ ## type ## _internal *) ptr, next) -# define INTERNAL(ptr) \ - INTERNAL_ASSOCIATIONS(ptr, (void) 0) -#endif - -#endif - diff --git a/libswc/shell_surface.c b/libswc/shell_surface.c @@ -23,7 +23,6 @@ #include "swc.h" #include "compositor_surface.h" -#include "internal.h" #include "shell_surface.h" #include "window.h" diff --git a/libswc/window.c b/libswc/window.c @@ -24,13 +24,14 @@ #include "window.h" #include "compositor.h" #include "compositor_surface.h" -#include "internal.h" #include "private.h" #include "swc.h" #include <stdlib.h> #include <string.h> +#define INTERNAL(window) ((struct swc_window_internal *) (window)) + static void handle_window_enter(struct wl_listener * listener, void * data) { struct swc_event * event = data;