Allow for non-GUI win32 apps.

This commit is contained in:
Oliver Schmidt 2011-04-03 10:56:18 +02:00
parent 26f0a6e88e
commit 4a731dfda9
5 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1 @@
DEFINES = WITH_GUI

View file

@ -0,0 +1 @@
DEFINES = WITH_GUI

View file

@ -0,0 +1 @@
DEFINES = WITH_GUI

View file

@ -0,0 +1 @@
DEFINES = WITH_GUI

View file

@ -54,9 +54,15 @@
#include "program-handler.h" #include "program-handler.h"
#endif /* PLATFORM_BUILD */ #endif /* PLATFORM_BUILD */
#if WITH_GUI
#define CTK_PROCESS &ctk_process,
#else /* WITH_GUI */
#define CTK_PROCESS
#endif /* WITH_GUI */
PROCINIT(&etimer_process, PROCINIT(&etimer_process,
&wpcap_process, &wpcap_process,
&ctk_process, CTK_PROCESS
&tcpip_process, &tcpip_process,
&resolv_process); &resolv_process);
@ -71,7 +77,11 @@ debug_printf(char *format, ...)
vsprintf(buffer, format, argptr); vsprintf(buffer, format, argptr);
va_end(argptr); va_end(argptr);
#if WITH_GUI
OutputDebugString(buffer); OutputDebugString(buffer);
#else /* WITH_GUI */
fputs(buffer, stderr);
#endif /* WITH_GUI */
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void
@ -130,9 +140,11 @@ main(void)
/* Allow user-mode APC to execute. */ /* Allow user-mode APC to execute. */
SleepEx(10, TRUE); SleepEx(10, TRUE);
#if WITH_GUI
if(console_resize()) { if(console_resize()) {
ctk_restore(); ctk_restore();
} }
#endif /* WITH_GUI */
} }
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/