Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-09

offsetof()-macro in pascal

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

I'd like to know if there is something similar to this:

<stddef.h>
#define offsetof(type, member) __offsetof(type, member) </sdtdef.h>

<ansi.h>
#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) </ansi.h>

predefined in pascal or a translation of it.

Is it possible to have this defined generically like the macro or does it need to be one definition for each "type"?

TIA,
Marc

Reply by email