mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-03-03 05:29:19 +00:00
Support FreeBSD 5.3:
- fix implementation of offsetof() with GCC >= 3.4 and C++ code
This commit is contained in:
parent
3aeed84471
commit
6d5303c868
@ -41,6 +41,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
@ -63,6 +64,17 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Fix offsetof() on FreeBSD and GCC >= 3.4
|
||||
#if defined(__FreeBSD__) && defined(__cplusplus)
|
||||
#undef offsetof
|
||||
/* The cast to "char &" below avoids problems with user-defined
|
||||
"operator &", which can appear in a POD type. */
|
||||
#define offsetof(TYPE, MEMBER) \
|
||||
(__offsetof__ (reinterpret_cast <size_t> \
|
||||
(&reinterpret_cast <char &> \
|
||||
(static_cast<TYPE *> (0)->MEMBER))))
|
||||
#endif
|
||||
|
||||
// Define for external components
|
||||
#define SHEEPSHAVER 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user