Changeset 3736


Ignore:
Timestamp:
Oct 3, 2011, 2:11:48 AM (14 years ago)
Author:
bird
Message:

sys/cdefs.h: Our gcc 3.3.5 doesn't seem to grok offsetof.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/include/sys/cdefs.h

    r3717 r3736  
    66 * @changed bird: Check if stuff is defined before accessing it in #if. Stops -Wundef
    77 *                from bitching.
     8 * @changed bird: __offsetof__ was apparently introduced in gcc 3.4.x.
    89 */
    910 
     
    329330#define __offsetof(type, field)  __builtin_offsetof(type, field)
    330331#else
    331 #ifndef __cplusplus
     332#if !defined(__cplusplus) || !__GNUC_PREREQ(3,4) /* bird: __offsetof__ was introduced in 3.4.x.  */
    332333#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
    333334#else
Note: See TracChangeset for help on using the changeset viewer.