foxygit / doom Log in
commit 1a54277adf6413026ccd77435601bcb50f1aa169
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Jun 7 15:21:41 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Jun 7 15:21:41 2009 +0000

    Fix setup tool compile on Windows CE.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1567
---
 setup/Makefile.am |  5 ++++-
 setup/execute.c   | 27 ++++++++++++++++++++++-----
 setup/mainmenu.c  |  2 ++
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/setup/Makefile.am b/setup/Makefile.am
index b7b05520..22bcb224 100644
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -31,7 +31,10 @@ else
 chocolate_setup_SOURCES=$(SOURCE_FILES)
 endif

-chocolate_setup_LDADD = ../textscreen/libtextscreen.a @LDFLAGS@
+chocolate_setup_LDADD =                              \
+                       ../wince/libc_wince.a         \
+                       ../textscreen/libtextscreen.a \
+                       @LDFLAGS@

 .rc.o:
 	$(WINDRES) $^ -o $@
diff --git a/setup/execute.c b/setup/execute.c
index b5b8a7c6..8f082de7 100644
--- a/setup/execute.c
+++ b/setup/execute.c
@@ -28,11 +28,19 @@

 #include <sys/types.h>

-#ifndef _WIN32
-    #include <sys/wait.h>
-    #include <unistd.h>
+#if defined(_WIN32_WCE)
+
+#include "libc_wince.h"
+
+#elif defined(_WIN32)
+
+#include <sys/wait.h>
+#include <unistd.h>
+
 #else
-    #include <process.h>
+
+#include <process.h>
+
 #endif

 #include "textscreen.h"
@@ -139,7 +147,16 @@ void AddCmdLineParameter(execute_context_t *context, char *s, ...)
     fprintf(context->stream, "\n");
 }

-#ifdef _WIN32
+#if defined(_WIN32_WCE)
+
+static int ExecuteCommand(const char **argv)
+{
+    // Windows CE version.
+    // TODO
+    return 0;
+}
+
+#elif defined(_WIN32)

 static int ExecuteCommand(const char **argv)
 {
diff --git a/setup/mainmenu.c b/setup/mainmenu.c
index d4dfe0db..d340661b 100644
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -18,7 +18,9 @@
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 // 02111-1307, USA.
 //
+
 #include <stdlib.h>
+#include <string.h>

 #include "config.h"
 #include "textscreen.h"