Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-2] src/include



Module Name:    src
Committed By:   riz
Date:           Sun Sep  3 00:33:25 UTC 2006

Modified Files:
        src/include [netbsd-2]: stddef.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #10676):
        include/stddef.h: revision 1.11
        include/stddef.h: revision 1.12
        include/stddef.h: revision 1.13
        include/stddef.h: revision 1.14
        include/stddef.h: revision 1.15
Use gcc's builtin function.  This permits c++ compiliation of const
expressions using offsetof.  Boost-python relies on this, for example.
g++-4 does not like &0->member, so we have to use the built-in offsetof().
g++-3 does not have a built-in offsetof(), but we cannot use the c version,
      otherwise we break with -Wold-style-cast.
Inspired by the DF version, but a bit different.
gcc-3.3 does not have __offsetof__, but gcc-3.4 eems to require it:
>From the redhat web page:
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/offsetof.html
__offsetof__ (expression)
    is equivalent to the parenthesized expression, except that the
    expression is considered an integral constant expression even if
    it contains certain operators that are not normally permitted in
    an integral constant expression. Users should never use __offsetof__
    directly; the only valid use of __offsetof__ is to implement the
    offsetof macro in <stddef.h>.
__offsetof__ is a builtin, so we need __GNU_PREREQ
Use __GNUC_PREREQ__() for the GCC 4 test, too.


To generate a diff of this commit:
cvs rdiff -r1.10 -r1.10.4.1 src/include/stddef.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index