diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-10-18 14:26:18 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-10-18 14:26:18 +0000 |
commit | 52fa622ab6423e3d2b7eff94d9b3e7610b0fa26b (patch) | |
tree | 160a9d4d78cf5fc21e3b2142ae74a44f30ba47bc /winsup/cygserver/sysv_sem.cc | |
parent | eedf24742c9c261a49f9ffdb7a2bc28ff5992fc2 (diff) | |
download | newlib-52fa622ab6423e3d2b7eff94d9b3e7610b0fa26b.zip newlib-52fa622ab6423e3d2b7eff94d9b3e7610b0fa26b.tar.gz newlib-52fa622ab6423e3d2b7eff94d9b3e7610b0fa26b.tar.bz2 |
* sysv_sem.cc: Redefine offsetof to circumvent build problems with
gcc 3.4.
Diffstat (limited to 'winsup/cygserver/sysv_sem.cc')
-rw-r--r-- | winsup/cygserver/sysv_sem.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygserver/sysv_sem.cc b/winsup/cygserver/sysv_sem.cc index a4acf37..bcd0dc2 100644 --- a/winsup/cygserver/sysv_sem.cc +++ b/winsup/cygserver/sysv_sem.cc @@ -147,6 +147,15 @@ struct sem_undo { #define SEMAEM 16384 /* adjust on exit max value */ #endif +#ifdef __CYGWIN__ +/* gcc 3.4 defines a new offsetof which is different for C++. Since this + file is just a derived plain-C file, we need to revert to the plain-C + definition of offsetof. */ +#ifdef offsetof +#undef offsetof +#endif +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif /* __CYGWIN__ */ /* * Due to the way semaphore memory is allocated, we have to ensure that * SEMUSZ is properly aligned. |