Re: #define GEVHDRSZ ( offsetof(GistEntryVector, vector[0]) ) explanation please
В списке pgsql-hackers по дате отправления:
| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: #define GEVHDRSZ ( offsetof(GistEntryVector, vector[0]) ) explanation please |
| Дата | |
| Msg-id | 20061208221014.GK25912@svana.org обсуждение исходный текст |
| Ответ на | #define GEVHDRSZ ( offsetof(GistEntryVector, vector[0]) ) explanation please ("jorge alberto" <jorge.is.a.geek@gmail.com>) |
| Список | pgsql-hackers |
On Fri, Dec 08, 2006 at 11:53:23AM -0500, jorge alberto wrote: > hi! > Can you tell me what does this line means > #define GEVHDRSZ ( offsetof(GistEntryVector, vector[0]) ) > > #ifndef offsetof > #define offsetof(type, field) ((long) &((type *)0)->field) > #endif /* offsetof */ It's defining the GEVHDRSZ constant to be the offset of the vector field in the GistEntryVector structure. The offsetof definition is for systems that don't define it already. It cleverly determines the offset by asking for the address of the vector field if the structure is placed at address zero. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера