scummvm random work
[patches.git] / wine-debug-checks.patch
1 2006-04-15 Mike Frysinger <vapier@gentoo.org>
2
3 * libs/wine/Makefile.in (EXTRADEFS): Add @DLLDEFS@.
4 * libs/wine/debug.c: (parse_options): Compare WINEDEBUG runtime envvar to
5 WINE_NO_TRACE_MSGS and WINE_NO_DEBUG_MSGS compile time defines.
6
7 --- libs/wine/Makefile.in
8 +++ libs/wine/Makefile.in
9 @@ -5,7 +5,7 @@ VPATH = @srcdir@
10 LIBRARY = wine
11 SOVERSION = 1
12 VERSCRIPT = $(SRCDIR)/wine.map
13 -EXTRADEFS = -D__WINESRC__
14 +EXTRADEFS = -D__WINESRC__ @DLLDEFS@
15 EXTRALIBS = $(LIBPORT) @DLLIBS@ @CRTLIBS@
16
17 C_SRCS = \
18 --- libs/wine/debug.c
19 +++ libs/wine/debug.c
20 @@ -138,6 +138,26 @@ static void parse_options( const char *s
21 if (len != (p - opt)) continue;
22 if (!memcmp( opt, debug_classes[i], len )) /* found it */
23 {
24 +#ifdef WINE_NO_DEBUG_MSGS
25 + if (memcmp( opt, "trace", len ) != 0)
26 + {
27 + static const char error_msg[] =
28 + "Unable to trace as Wine was configured without debug support.\n"
29 + "You will need to rebuild wine with the --enable-debug configure option.\n";
30 + write( 2, error_msg, sizeof(error_msg) - 1 );
31 + exit(1);
32 + }
33 +#endif
34 +#ifdef WINE_NO_TRACE_MSGS
35 + if (memcmp( opt, "trace", len ) == 0)
36 + {
37 + static const char error_msg[] =
38 + "Unable to trace as Wine was configured without trace support.\n"
39 + "You will need to rebuild wine with the --enable-trace configure option.\n";
40 + write( 2, error_msg, sizeof(error_msg) - 1 );
41 + exit(1);
42 + }
43 +#endif
44 if (*p == '+') set |= 1 << i;
45 else clear |= 1 << i;
46 break;
47 @@ -171,7 +191,14 @@ static void debug_usage(void)
48 " WINEDEBUG=[class]+xxx,[class]-yyy,...\n\n"
49 "Example: WINEDEBUG=+all,warn-heap\n"
50 " turns on all messages except warning heap messages\n"
51 - "Available message classes: err, warn, fixme, trace\n";
52 + "Available message classes: err, warn, fixme, trace\n"
53 +#ifdef WINE_NO_DEBUG_MSGS
54 + "\n* err/warn/fixme support has been disabled due to --disable-debug\n"
55 +#endif
56 +#ifdef WINE_NO_TRACE_MSGS
57 + "\n* trace support has been disabled due to --disable-trace\n"
58 +#endif
59 + ;
60 write( 2, usage, sizeof(usage) - 1 );
61 exit(1);
62 }