Build cleanly with clang
authorRan Benita <ran234@gmail.com>
Sat, 2 Mar 2013 18:43:57 +0000 (20:43 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 18 Mar 2013 22:20:04 +0000 (22:20 +0000)
clang doesn't like the use of typeof with out default flags, so just
don't use it.

Signed-off-by: Ran Benita <ran234@gmail.com>
configure.ac
src/darray.h
src/xkbcomp/keymap.c

index 7ecca9c..a0fcfe6 100644 (file)
@@ -50,7 +50,6 @@ XORG_WITH_DOXYGEN
 
 # Check for compiler features
 AC_C_INLINE
-AC_C_TYPEOF
 
 # Check for programs
 AC_PROG_MKDIR_P
index 569576e..0cf3747 100644 (file)
@@ -218,12 +218,6 @@ typedef darray (unsigned long)  darray_ulong;
     darray_prepend_items(arr, __src, sizeof(__src) / sizeof(*__src)); \
 } while (0)
 
-#define darray_appends(arr, ...) \
-    darray_appends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
-
-#define darray_prepends(arr, ...) \
-    darray_prepends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
-
 /*** Removal ***/
 
 /* Warning: Do not call darray_pop on an empty darray. */
index 1d69245..6686948 100644 (file)
@@ -233,7 +233,7 @@ UpdateBuiltinKeymapFields(struct xkb_keymap *keymap)
      * Add predefined (AKA real, core, X11) modifiers.
      * The order is important!
      */
-    darray_appends(keymap->mods,
+    darray_appends_t(keymap->mods, struct xkb_mod,
         { .name = xkb_atom_intern(ctx, "Shift"),   .type = MOD_REAL },
         { .name = xkb_atom_intern(ctx, "Lock"),    .type = MOD_REAL },
         { .name = xkb_atom_intern(ctx, "Control"), .type = MOD_REAL },