* sysv_sem.cc: Redefine offsetof to circumvent build problems with

gcc 3.4.
This commit is contained in:
Corinna Vinschen 2004-10-18 14:26:18 +00:00
parent eedf24742c
commit 52fa622ab6
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-10-18 Corinna Vinschen <corinna@vinschen.de>
* sysv_sem.cc: Redefine offsetof to circumvent build problems with
gcc 3.4.
2004-10-04 Corinna Vinschen <corinna@vinschen.de> 2004-10-04 Corinna Vinschen <corinna@vinschen.de>
* bsd_mutex.cc (_msleep): Simplify event creation. Revert change from * bsd_mutex.cc (_msleep): Simplify event creation. Revert change from

View File

@ -147,6 +147,15 @@ struct sem_undo {
#define SEMAEM 16384 /* adjust on exit max value */ #define SEMAEM 16384 /* adjust on exit max value */
#endif #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 * Due to the way semaphore memory is allocated, we have to ensure that
* SEMUSZ is properly aligned. * SEMUSZ is properly aligned.