_DBUS_STRUCT_OFFSET

Miloslav Trmac mitr@volny.cz
Sat, 28 Jun 2003 05:42:05 +0200


On Fri, Jun 27, 2003 at 11:19:43PM -0400, Havoc Pennington wrote:
> On Sat, Jun 28, 2003 at 05:08:47AM +0200, Miloslav Trmac wrote:
> > attached patch removes _DBUS_STRUCT_OFFSET. The offsetof macro in
> > <stddef.h> is defined by ANSI C and its usage does not invoke undefined
> > behavior, which _DBUS_STRUCT_OFFSET does, strictly speaking.
> Maybe a configure check for offsetof and then implement
> _DBUS_STRUCT_OFFSET in terms of it if present?
offsetof is required by ANSI C (1989), D-BUS doesn't look like aiming
lower than that. OTOH, in all cases I have seen, offsetof is implemented
in a way similar to _DBUS_STRUCT_OFFSET, so keeping it should make no
problems in practice.
	Mirek