f23b59bbf5
teeth-grindingly ok'd by aja
51 lines
1.7 KiB
Plaintext
51 lines
1.7 KiB
Plaintext
$OpenBSD: patch-girepository_giroffsets_c,v 1.4 2010/10/24 13:40:27 jasper Exp $
|
|
|
|
Prevent redefinition of ALIGN in giroffsets.c with /usr/include/machine/param.h
|
|
|
|
--- girepository/giroffsets.c.orig Tue Aug 17 19:14:51 2010
|
|
+++ girepository/giroffsets.c Thu Sep 30 15:25:34 2010
|
|
@@ -314,7 +314,7 @@ get_field_size_alignment (GIrTypelibBuild *build,
|
|
return success;
|
|
}
|
|
|
|
-#define ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1))
|
|
+#define G_ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1))
|
|
|
|
static gboolean
|
|
compute_struct_field_offsets (GIrTypelibBuild *build,
|
|
@@ -346,7 +346,7 @@ compute_struct_field_offsets (GIrTypelibBuild *build
|
|
if (get_field_size_alignment (build, field, node,
|
|
&member_size, &member_alignment))
|
|
{
|
|
- size = ALIGN (size, member_alignment);
|
|
+ size = G_ALIGN (size, member_alignment);
|
|
alignment = MAX (alignment, member_alignment);
|
|
field->offset = size;
|
|
size += member_size;
|
|
@@ -360,14 +360,14 @@ compute_struct_field_offsets (GIrTypelibBuild *build
|
|
}
|
|
else if (member->type == G_IR_NODE_CALLBACK)
|
|
{
|
|
- size = ALIGN (size, ffi_type_pointer.alignment);
|
|
+ size = G_ALIGN (size, ffi_type_pointer.alignment);
|
|
alignment = MAX (alignment, ffi_type_pointer.alignment);
|
|
size += ffi_type_pointer.size;
|
|
}
|
|
}
|
|
|
|
/* Structs are tail-padded out to a multiple of their alignment */
|
|
- size = ALIGN (size, alignment);
|
|
+ size = G_ALIGN (size, alignment);
|
|
|
|
if (!have_error)
|
|
{
|
|
@@ -423,7 +423,7 @@ compute_union_field_offsets (GIrTypelibBuild *build,
|
|
}
|
|
|
|
/* Unions are tail-padded out to a multiple of their alignment */
|
|
- size = ALIGN (size, alignment);
|
|
+ size = G_ALIGN (size, alignment);
|
|
|
|
if (!have_error)
|
|
{
|