Skip to content

Commit

Permalink
Allow for non-GUI win32 apps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Schmidt committed Apr 3, 2011
1 parent 26f0a6e commit 4a731df
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/email/Makefile.win32.defines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEFINES = WITH_GUI
1 change: 1 addition & 0 deletions examples/ftp/Makefile.win32.defines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEFINES = WITH_GUI
1 change: 1 addition & 0 deletions examples/irc/Makefile.win32.defines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEFINES = WITH_GUI
1 change: 1 addition & 0 deletions examples/webbrowser/Makefile.win32.defines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEFINES = WITH_GUI
14 changes: 13 additions & 1 deletion platform/win32/contiki-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@
#include "program-handler.h"
#endif /* PLATFORM_BUILD */

#if WITH_GUI
#define CTK_PROCESS &ctk_process,
#else /* WITH_GUI */
#define CTK_PROCESS
#endif /* WITH_GUI */

PROCINIT(&etimer_process,
&wpcap_process,
&ctk_process,
CTK_PROCESS
&tcpip_process,
&resolv_process);

Expand All @@ -71,7 +77,11 @@ debug_printf(char *format, ...)
vsprintf(buffer, format, argptr);
va_end(argptr);

#if WITH_GUI
OutputDebugString(buffer);
#else /* WITH_GUI */
fputs(buffer, stderr);
#endif /* WITH_GUI */
}
/*-----------------------------------------------------------------------------------*/
void
Expand Down Expand Up @@ -130,9 +140,11 @@ main(void)
/* Allow user-mode APC to execute. */
SleepEx(10, TRUE);

#if WITH_GUI
if(console_resize()) {
ctk_restore();
}
#endif /* WITH_GUI */
}
}
/*-----------------------------------------------------------------------------------*/

0 comments on commit 4a731df

Please sign in to comment.