diff options
Diffstat (limited to 'uisimulator/win32/debug-win32.c')
-rw-r--r-- | uisimulator/win32/debug-win32.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/uisimulator/win32/debug-win32.c b/uisimulator/win32/debug-win32.c deleted file mode 100644 index dbc0f10e85..0000000000 --- a/uisimulator/win32/debug-win32.c +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Felix Arends | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include <windows.h> | ||
21 | #include <stdio.h> | ||
22 | |||
23 | char debugmembuf[200]; | ||
24 | |||
25 | void debug( const char *message ) | ||
26 | { | ||
27 | static int debugger = -1; | ||
28 | |||
29 | if (debugger == -1) | ||
30 | { | ||
31 | HINSTANCE hInst = LoadLibrary("kernel32.dll"); | ||
32 | debugger = 0; | ||
33 | |||
34 | if (hInst != NULL) | ||
35 | { | ||
36 | FARPROC pIsDebuggerPresent = GetProcAddress(hInst, "IsDebuggerPresent"); | ||
37 | if (pIsDebuggerPresent != NULL) | ||
38 | debugger = pIsDebuggerPresent(); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | if (debugger) | ||
43 | OutputDebugString (message); | ||
44 | else | ||
45 | printf("%s", message); | ||
46 | } | ||
47 | |||
48 | void debugf(const char *fmt, ...) | ||
49 | { | ||
50 | va_list ap; | ||
51 | |||
52 | va_start( ap, fmt ); | ||
53 | wvsprintf( debugmembuf, fmt, ap ); | ||
54 | va_end( ap ); | ||
55 | debug ( debugmembuf ); | ||
56 | } | ||
57 | |||
58 | void Logf(char *fmt, ...) | ||
59 | { | ||
60 | va_list ap; | ||
61 | |||
62 | va_start( ap, fmt ); | ||
63 | wvsprintf( debugmembuf, fmt, ap ); | ||
64 | va_end( ap ); | ||
65 | debug ( debugmembuf ); | ||
66 | } | ||