Author: benny Date: 2006-08-30 10:20:42 +0000 (Wed, 30 Aug 2006) New Revision: 22947
Modified: libxfce4util/trunk/ChangeLog libxfce4util/trunk/libxfce4util/xfce-generics.h Log: 2006-08-30 Benedikt Meurer <[EMAIL PROTECTED]> * libxfce4util/xfce-generics.h: Enable compilation with Sun Studio Pro. Bug #1851. Modified: libxfce4util/trunk/ChangeLog =================================================================== --- libxfce4util/trunk/ChangeLog 2006-08-30 10:17:45 UTC (rev 22946) +++ libxfce4util/trunk/ChangeLog 2006-08-30 10:20:42 UTC (rev 22947) @@ -1,3 +1,8 @@ +2006-08-30 Benedikt Meurer <[EMAIL PROTECTED]> + + * libxfce4util/xfce-generics.h: Enable compilation with Sun Studio + Pro. Bug #1851. + 2006-08-12 Benedikt Meurer <[EMAIL PROTECTED]> * libxfce4util/xfce-generics.h(xfce_stack_top): Enable compilation Modified: libxfce4util/trunk/libxfce4util/xfce-generics.h =================================================================== --- libxfce4util/trunk/libxfce4util/xfce-generics.h 2006-08-30 10:17:45 UTC (rev 22946) +++ libxfce4util/trunk/libxfce4util/xfce-generics.h 2006-08-30 10:20:42 UTC (rev 22947) @@ -39,6 +39,7 @@ } +#ifdef __GNUC__ #define xfce_stack_new(StackType) \ ({ \ StackType *stack; \ @@ -50,6 +51,20 @@ \ stack; \ }) +#else +static inline gpointer +xfce_stack_alloc (gsize element_size) +{ + typedef struct { gpointer elements; gint nelements; gint top; } Stack; + Stack *stack = g_new (Stack, 1); + stack->elements = g_malloc (20 * element_size); + stack->nelements = 20; + stack->top = -1; + return stack; +} +#define xfce_stack_new(StackType) \ + ((StackType *) xfce_stack_alloc (sizeof (*(((StackType *) 0)->elements)))) +#endif #define xfce_stack_free(stack) \ _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits