Re: current winex CVS doesn't compile (ntdll)

Bryan Kadzban <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
Peter Hunnisett wrote:
> [email protected] wrote:
>> No effect, same error.
> 
> Not much of a surprise since it's not hooked up with anything in the 
> code (although the compile test is the correct test). The problem is 
> that the definition for the WINE_EXPECT is presently in winnt.h which 
> cannot rely on the output of include/config.h due to winelib 
> requirements.

Ahh, that'll teach me to not read the rest of the source.  I didn't even
realize that another define was in place.  *sheepish grin*

Anyway, maybe you could do something like what the kernel does (in
include/linux/compiler.h if you want to see it), inside winnt.h?
Something like the attached patch, which is modeled on the tests for
NONAMELESSSTRUCT and the kernel sources, might suffice.

Or is that what you were thinking of doing this week anyway?

Bryan
new-wine-expect.patch (text/plain, 769 B)
diff -u wine-old/include/winnt.h wine/include/winnt.h
--- wine-old/include/winnt.h	23 Jun 2003 01:46:24 -0000	1.9
+++ wine/include/winnt.h	24 Jul 2003 00:01:08 -0000
@@ -111,7 +111,12 @@
 #define WINE_PACKED   __attribute__((packed))
 #define WINE_UNUSED   __attribute__((unused))
 #define WINE_NORETURN __attribute__((noreturn))
-#define WINE_EXPECT( exp, c ) __builtin_expect( (exp), (c) )
+/* __builtin_expect support starts at gcc 2.96 */
+#  if (__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96))
+#    define WINE_EXPECT( exp, c ) (exp)
+#  else  /* gcc is >= 2.96 */
+#    define WINE_EXPECT( exp, c ) __builtin_expect( (exp), (c) )
+#  endif /* gcc version checking */
 #else
 #define WINE_PACKED    /* nothing */
 #define WINE_UNUSED    /* nothing */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.