glib-private.h: add _glib_alignof
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 16 Nov 2012 12:49:15 +0000 (12:49 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 20 Jan 2014 01:23:30 +0000 (20:23 -0500)
glib/glib-private.h

index 44cbf3d94e93535fbddac7055fcf4c21862dec8e..6195ad975b654d98ef2cea933266318cf08648ab 100644 (file)
 #include <glib.h>
 #include "gwakeup.h"
 
+#if defined(__GNUC__)
+# define _g_alignof(type) (__alignof__ (type))
+#else
+# define _g_alignof(type) (G_STRUCT_OFFSET (struct { char a; type b; }, b))
+#endif
+
 GMainContext *          g_get_worker_context            (void);
 gboolean                g_check_setuid                  (void);
 GMainContext *          g_main_context_new_with_next_id (guint next_id);