From e1bcdb20e9ac3e2f13c45a76a3e94dd5bebbba6f Mon Sep 17 00:00:00 2001
From: jehan monnier <jehan.monnier@gmail.com>
Date: Tue, 20 Oct 2009 22:34:02 +0200
Subject: [PATCH] start mingw32ce port

---
 linphone/oRTP/configure.ac         |  2 ++
 linphone/oRTP/src/port.c           |  2 +-
 linphone/scripts/cegcc-config.site | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 linphone/scripts/cegcc-config.site

diff --git a/linphone/oRTP/configure.ac b/linphone/oRTP/configure.ac
index 90da008aab..1412c23b44 100644
--- a/linphone/oRTP/configure.ac
+++ b/linphone/oRTP/configure.ac
@@ -98,6 +98,8 @@ case "$target_os" in
 		AC_DEFINE(NOCONNECT,1,[Defined if we should not use connect() on udp sockets])
 		PTHREAD_LDFLAGS="-pthread"
 		;;
+	*mingw32ce)
+		CFLAGS="$CFLAGS -D_WIN32_WCE";;
 	*mingw*)
 		CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
 		LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm"
diff --git a/linphone/oRTP/src/port.c b/linphone/oRTP/src/port.c
index 88ef75b212..73680f6594 100644
--- a/linphone/oRTP/src/port.c
+++ b/linphone/oRTP/src/port.c
@@ -225,7 +225,7 @@ int WIN_thread_create(ortp_thread_t *th, void *attr, void * (*func)(void *), voi
     thread_param_t *params=ortp_new(thread_param_t,1);
     params->func=func;
     params->arg=data;
-	*th=(HANDLE)_beginthreadex( NULL, 0, thread_starter, params, 0, NULL);
+	*th=(HANDLE)_beginthreadex( NULL, 0, (LPTHREAD_START_ROUTINE)thread_starter, params, 0, NULL);
 	return 0;
 }
 
diff --git a/linphone/scripts/cegcc-config.site b/linphone/scripts/cegcc-config.site
new file mode 100644
index 0000000000..f682f17bbd
--- /dev/null
+++ b/linphone/scripts/cegcc-config.site
@@ -0,0 +1,14 @@
+# -*- shell-script -*-
+
+
+ARCH=arm4l
+SDK_BIN_PATH=/opt/mingw32ce/bin     
+SYSROOT_PATH=/opt/mingw32ce
+
+CC="${SDK_BIN_PATH}/arm-mingw32ce-gcc -std=c99  -isysroot=${SYSROOT_PATH}"
+LD="${SDK_BIN_PATH}/arm-mingw32ce-ld "
+AR=${SDK_BIN_PATH}/arm-mingw32ce-ar
+RANLIB=${SDK_BIN_PATH}/arm-mingw32ce-ranlib
+
+CPPFLAGS="-Dasm=__asm"
+#LDFLAGS="-Wl,-syslibroot ${SYSROOT_PATH}" 
-- 
GitLab