Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Need macro to get offset within a structure Message-ID: <15254@smoke.brl.mil> Date: 19 Feb 91 23:35:38 GMT References: <1991Feb16.232713.6001@runx.oz.au> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 7 In article enag@ifi.uio.no (Erik Naggum) writes: >#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) What I would recommend is to key on __STDC__, #including in a Standard C environment and using a definition like that one in other environments. It should work in most non-standard C environments (but not all of them!).