After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652625 - Prevent redefinition of ALIGN
Prevent redefinition of ALIGN
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-06-15 08:29 UTC by Jasper Lievisse Adriaanse
Modified: 2015-02-07 16:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rename ALIGN to G_ALIGN (2.01 KB, patch)
2011-06-15 08:31 UTC, Jasper Lievisse Adriaanse
reviewed Details | Review

Description Jasper Lievisse Adriaanse 2011-06-15 08:29:41 UTC
On some platforms there is already a definition of ALIGN, like on OpenBSD in /usr/include/machine/param.h.

The attached diff renames the local definition to G_ALIGN to prevent a redefinition.
Comment 1 Jasper Lievisse Adriaanse 2011-06-15 08:31:06 UTC
Created attachment 189965 [details] [review]
Rename ALIGN to G_ALIGN
Comment 2 Jasper Lievisse Adriaanse 2011-06-21 09:50:14 UTC
Or should a construct like:
#ifdef ALIGN
#undef ALIGN
#endif

be used?
Comment 3 Colin Walters 2011-06-21 11:29:08 UTC
Review of attachment 189965 [details] [review]:

::: girepository/giroffsets.c
@@ +351,3 @@
 }
 
+#define G_ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1))

g-i is totally not consistent, but I've been trying to move new symbols/macros to be GI_ prefixed over G_, because we're not glib (at least, not yet).

So can you call it GI_ALIGN() ?
Comment 4 Jasper Lievisse Adriaanse 2011-06-21 11:41:38 UTC
Yep, OK to commit it as GI_ALIGN() then?
Comment 5 Colin Walters 2011-06-21 13:07:53 UTC
(In reply to comment #4)
> Yep, OK to commit it as GI_ALIGN() then?

Yep, thanks!
Comment 6 Antoine Jacoutot 2011-06-28 10:41:23 UTC
Hi.

Just for the sake of completeness, the ALIGN redefinition on OpenBSD was due to a bug in our glib package which I fixed a couple minutes ago in our ports tree.
That said, ALIGN is very generic, so I welcome the move to using GI_ALIGN.
Comment 7 André Klapper 2015-02-07 16:59:55 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]