Dmitry Timoshkov wrote:
"Erik de Castro Lopo" mle+win@mega-nerd.com wrote:
FIELD_OFFSET is defined in include/winnt.h.
Now I could include winnt.h into include/wine/list.h but that doesn't seem right. I could also copy it,but having two definitions of the same macro is also not right. I'm also sure that moving the definition from include/winnt.h to include/wine/list.h will break existing code.
Any suggestions for dealing with this?
Replacing (unsigned int) cast by (unsigned long) doesn't guarantee anything, long can be a 32-bit entity on a 64-bit platform.
I'm perfectly happy to accept that, but the real question was, "what is the best way to get FIELD_OFFSET in include/wine/list.h?".
I see four options:
0) Include include/winnt.h into include/wine/list.h. Ugly!
1) Copy definition of FIELD_OFFSET macro from include/winnt.h to include/wine/list.h. Ugly!
2) Move the definition of FIELD_OFFSET macro from include/winnt.h to include/wine/list.h. This will probably break existing code. Ugly!
3) Add a definition if FIELD_OFFSET wrapped in #ifndef. This is the least ugly option but would cause surprising results if one or the other was changed.
So, to rephrase the question, which of the above would actually be accepted as a patch? If none of them are good enough (highly likely) can someone please suggest an alternative that would be acceptable?
Cheers, Erik