Am Mittwoch 17 Januar 2007 11:11 schrieb [EMAIL PROTECTED]:
> I applied theese paches and after a few modifications (wich I send you
> later) I was able to compile the library itself on windows xp (msys/mingw),
> but the exaples fails with theese linker errors: gcc -Wall -O2
> -D_FORTIFY_SOURCE=2 -enable-auto-import -o irxfer.exe irxfer.o 
> ../lib/.libs/libopenobex.a -lusb -lws2_32 libmisc.a
> irxfer.o(.text+0x44):irxfer.c: undefined reference to `_imp__OBEX_Init'

Yes, the linking order is broken: libmisc.a must come before the others, see 
apps/Makefile.am (two lines must be changed).
Here is the patch for the apps/ directory (with a small change in 
bluez_compat.patch).

I also see that you compile the static lib only. Is there any reason to do so?
It cross-compiles fine but I also use gcc4 (no mingw release).

HS

PS: Don't mind the error at the end of building, it's only the doc/ subdir.
Index: openobex-anoncvs/lib/bluez_compat.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openobex-anoncvs/lib/bluez_compat.h	2007-01-17 11:44:32.830933139 +0100
@@ -0,0 +1,51 @@
+
+/* Here are the defines that make it possible to
+ * implement bluetooth with the Bluez API
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef _WIN32
+/* you need the headers files from the Platform SDK */
+#include <winsock2.h>
+#include <ws2bth.h>
+#define bdaddr_t    BTH_ADDR
+#define sockaddr_rc _SOCKADDR_BTH
+#define rc_family   addressFamily
+#define rc_bdaddr   btAddr
+#define rc_channel  port
+#define PF_BLUETOOTH   PF_BTH
+#define AF_BLUETOOTH   PF_BLUETOOTH
+#define BTPROTO_RFCOMM BTHPROTO_RFCOMM
+#define BDADDR_ANY     BTH_ADDR_NULL
+#define bacpy(dst,src) memcpy((dst),(src),sizeof(BTH_ADDR))
+#define bacmp(a,b)     memcmp((a),(b),sizeof(BTH_ADDR))
+
+#else /* _WIN32 */
+/* Linux/FreeBSD/NetBSD case */
+
+#if defined(HAVE_BLUETOOTH_LINUX)
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/rfcomm.h>
+
+#elif defined(HAVE_BLUETOOTH_FREEBSD)
+#include <bluetooth.h>
+#define sockaddr_rc sockaddr_rfcomm
+#define rc_family   rfcomm_family
+#define rc_bdaddr   rfcomm_bdaddr
+#define rc_channel  rfcomm_channel
+
+#elif defined(HAVE_BLUETOOTH_NETBSD)
+#include <bluetooth.h>
+#include <netbt/rfcomm.h>
+#define sockaddr_rc sockaddr_bt
+#define rc_family   bt_family
+#define rc_bdaddr   bt_bdaddr
+#define rc_channel  bt_channel
+#define BDADDR_ANY  NG_HCI_BDADDR_ANY
+
+#endif /* HAVE_BLUETOOTH_* */
+
+#endif /* _WIN32 */
Index: openobex-anoncvs/lib/btobex.c
===================================================================
--- openobex-anoncvs.orig/lib/btobex.c	2007-01-17 11:30:44.135142889 +0100
+++ openobex-anoncvs/lib/btobex.c	2007-01-17 11:30:45.427223639 +0100
@@ -45,27 +45,6 @@
 #include <errno.h>		/* errno and EADDRNOTAVAIL */
 #include <netinet/in.h>
 #include <sys/socket.h>
-
-#ifdef HAVE_BLUETOOTH_LINUX
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#endif
-#ifdef HAVE_BLUETOOTH_FREEBSD
-#include <bluetooth.h>
-#define sockaddr_rc  sockaddr_rfcomm
-#define rc_family    rfcomm_family
-#define rc_bdaddr    rfcomm_bdaddr
-#define rc_channel   rfcomm_channel
-#endif
-#ifdef HAVE_BLUETOOTH_NETBSD
-#define rc_family    bt_family
-#define rc_bdaddr    bt_bdaddr
-#define rc_channel   bt_channel
-#define sockaddr_rc  sockaddr_bt
-#include <bluetooth.h>
-#include <netbt/rfcomm.h>
-#endif
-
 #endif /* _WIN32 */
 
 #include "obex_main.h"
@@ -79,7 +58,6 @@
  */
 void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
 {
-#ifndef _WIN32
 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
 	self->trans.self.rfcomm.rc_channel = 0;
@@ -87,7 +65,6 @@
 	self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
 	bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
 	self->trans.peer.rfcomm.rc_channel = channel;
-#endif /* _WIN32 */
 }
 
 /*
@@ -98,12 +75,10 @@
  */
 void btobex_prepare_listen(obex_t *self, bdaddr_t *src, uint8_t channel)
 {
-#ifndef _WIN32
 	/* Bind local service */
 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
 	self->trans.self.rfcomm.rc_channel = channel;
-#endif /* _WIN32 */
 }
 
 /*
@@ -114,7 +89,6 @@
  */
 int btobex_listen(obex_t *self)
 {
-#ifndef _WIN32
 	DEBUG(3, "\n");
 
 	self->serverfd = obex_create_socket(self, AF_BLUETOOTH);
@@ -142,7 +116,6 @@
 out_freesock:
 	obex_delete_socket(self, self->serverfd);
 	self->serverfd = INVALID_SOCKET;
-#endif /* _WIN32 */
 	return -1;
 }
 
@@ -156,7 +129,6 @@
  */
 int btobex_accept(obex_t *self)
 {
-#ifndef _WIN32
 	socklen_t addrlen = sizeof(struct sockaddr_rc);
 	//int mtu;
 	//int len = sizeof(int);
@@ -170,7 +142,6 @@
 	}
 
 	self->trans.mtu = OBEX_DEFAULT_MTU;
-#endif /* _WIN32 */
 	return 0;
 }
 	
@@ -183,7 +154,6 @@
 int btobex_connect_request(obex_t *self)
 {
 	int ret;
-#ifndef _WIN32
 	int mtu = 0;
 	//int len = sizeof(int);
 
@@ -220,7 +190,6 @@
 out_freesock:
 	obex_delete_socket(self, self->fd);
 	self->fd = INVALID_SOCKET;
-#endif /* _WIN32 */
 	return ret;	
 }
 
@@ -233,13 +202,11 @@
 int btobex_disconnect_request(obex_t *self)
 {
 	int ret;
-#ifndef _WIN32
 	DEBUG(4, "\n");
 	ret = obex_delete_socket(self, self->fd);
 	if(ret < 0)
 		return ret;
 	self->fd = INVALID_SOCKET;
-#endif /* _WIN32 */
 	return ret;	
 }
 
@@ -254,11 +221,9 @@
 int btobex_disconnect_server(obex_t *self)
 {
 	int ret;
-#ifndef _WIN32
 	DEBUG(4, "\n");
 	ret = obex_delete_socket(self, self->serverfd);
 	self->serverfd = INVALID_SOCKET;
-#endif /* _WIN32 */
 	return ret;	
 }
 
Index: openobex-anoncvs/lib/btobex.h
===================================================================
--- openobex-anoncvs.orig/lib/btobex.h	2007-01-17 11:30:26.486039889 +0100
+++ openobex-anoncvs/lib/btobex.h	2007-01-17 11:30:45.467226139 +0100
@@ -30,6 +30,8 @@
 #ifndef BTOBEX_H
 #define BTOBEX_H
 
+#include "bluez_compat.h"
+
 void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel);
 void btobex_prepare_listen(obex_t *self, bdaddr_t *src, uint8_t channel);
 int btobex_listen(obex_t *self);
Index: openobex-anoncvs/lib/obex.c
===================================================================
--- openobex-anoncvs.orig/lib/obex.c	2007-01-17 11:30:44.215147889 +0100
+++ openobex-anoncvs/lib/obex.c	2007-01-17 11:30:45.483227139 +0100
@@ -43,6 +43,14 @@
 #ifdef DLL_EXPORT
 #define LIB_SYMBOL __declspec(dllexport)
 #endif
+static unsigned long wsa_init = 0;
+#if HAVE_BLUETOOTH
+#define WSA_VER_MAJOR 2
+#define WSA_VER_MINOR 2
+#else
+#define WSA_VER_MAJOR 2
+#define WSA_VER_MINOR 0
+#endif
 
 #else /* _WIN32 */
 #include <fcntl.h>
@@ -63,17 +71,17 @@
 #include "obex_client.h"
 
 #include "inobex.h"
+
 #ifdef HAVE_IRDA
 #include "irobex.h"
 #endif
+
 #ifdef HAVE_USB
 #include "usbobex.h"
 #endif
+
 #ifdef HAVE_BLUETOOTH
 #include "btobex.h"
-#ifdef HAVE_BLUETOOTH_FREEBSD
-#define BDADDR_ANY  NG_HCI_BDADDR_ANY
-#endif
 #else
 // This is to workaround compilation without Bluetooth support. - Jean II
 typedef char *bdaddr_t;
@@ -115,13 +123,21 @@
 	obex_return_val_if_fail(eventcb != NULL, NULL);
 
 #ifdef _WIN32
-	{
+	if (!wsa_init) {
+		WORD ver = MAKEWORD(WSA_VER_MAJOR,WSA_VER_MINOR);
 		WSADATA WSAData;
-	  	if (WSAStartup (MAKEWORD(2,0), &WSAData) != 0) {
-			DEBUG(4, "WSAStartup failed\n");
+	  	if (WSAStartup (ver, &WSAData) != 0) {
+			DEBUG(4, "WSAStartup failed (%d)\n",WSAGetLastError());
+			return NULL;
+		}
+		if (LOBYTE(WSAData.wVersion) != WSA_VER_MAJOR ||
+		    HIBYTE(WSAData.wVersion) != WSA_VER_MINOR) {
+			DEBUG(4, "WSA version mismatch\n");
+			WSACleanup();
 			return NULL;
 		}
 	}
+	++wsa_init;
 #endif
 
 	self = malloc(sizeof(obex_t));
Index: openobex-anoncvs/acinclude.m4
===================================================================
--- openobex-anoncvs.orig/acinclude.m4	2007-01-17 11:30:26.698053139 +0100
+++ openobex-anoncvs/acinclude.m4	2007-01-17 11:30:45.511228889 +0100
@@ -64,6 +64,16 @@
 	])
 ])
 
+AC_DEFUN([AC_PATH_WINBT], [
+       AC_CACHE_CHECK([for Windows Bluetooth support],winbt_found,[
+               AC_CHECK_HEADERS(ws2bth.h, winbt_found=yes, winbt_found=no,
+                                [
+                                  #include <winsock2.h>
+               ])
+       ])
+])
+
+
 AC_DEFUN([AC_PATH_NETBSDBT], [
 	AC_CACHE_CHECK([for NetBSD Bluetooth support], netbsdbt_found, [
 		AC_TRY_COMPILE([
@@ -85,9 +95,7 @@
 ])
 
 AC_DEFUN([AC_PATH_BLUEZ], [
-	PKG_CHECK_MODULES(BLUEZ, bluez, bluez_found=yes, AC_MSG_RESULT(no))
-	AC_SUBST(BLUEZ_CFLAGS)
-	AC_SUBST(BLUEZ_LIBS)
+	PKG_CHECK_MODULES(BLUETOOTH, bluez, bluez_found=yes, AC_MSG_RESULT(no))
 ])
 
 AC_DEFUN([AC_PATH_BLUETOOTH], [
@@ -101,7 +109,12 @@
 	*-*-netbsd*)
 		AC_PATH_NETBSDBT
 		;;
+	*-*-mingw32*)
+		AC_PATH_WINBT
+		;;
 	esac
+	AC_SUBST(BLUETOOTH_CFLAGS)
+	AC_SUBST(BLUETOOTH_LIBS)
 ])
 
 AC_DEFUN([AC_PATH_USB], [
@@ -196,6 +209,10 @@
 		AC_DEFINE(HAVE_IRDA, 1, [Define if system supports IrDA and it's enabled])
 	fi
 
+        if (test "${bluetooth_enable}" = "yes" && test "${winbt_found}" = "yes"); then
+                AC_DEFINE(HAVE_BLUETOOTH, 1, [Define if system supports Bluetooth and it's enabled])
+        fi
+
 	if (test "${bluetooth_enable}" = "yes" && test "${netbsdbt_found}" = "yes"); then
 		AC_DEFINE(HAVE_BLUETOOTH, 1, [Define if system supports Bluetooth and it's enabled])
 		AC_DEFINE(HAVE_BLUETOOTH_NETBSD, 1, [Define if system supports Bluetooth stack for NetBSD])
Index: openobex-anoncvs/apps/Makefile.am
===================================================================
--- openobex-anoncvs.orig/apps/Makefile.am	2007-01-17 11:30:26.754056639 +0100
+++ openobex-anoncvs/apps/Makefile.am	2007-01-17 11:43:10.241771639 +0100
@@ -14,11 +14,11 @@
 	obex_test_server.c obex_test_server.h \
 	obex_test_cable.c obex_test_cable.h
 
-obex_test_LDADD = $(top_builddir)/lib/libopenobex.la @BLUEZ_LIBS@ libmisc.a
+obex_test_LDADD = $(top_builddir)/lib/libopenobex.la @BLUETOOTH_LIBS@ libmisc.a
 
 LDADD = $(top_builddir)/lib/libopenobex.la libmisc.a
 
-INCLUDES = @BLUEZ_CFLAGS@ -I$(top_builddir)/include
+INCLUDES = @BLUETOOTH_CFLAGS@ -I$(top_builddir)/include
 endif
 
 MAINTAINERCLEANFILES = Makefile.in
Index: openobex-anoncvs/lib/obex_transport.h
===================================================================
--- openobex-anoncvs.orig/lib/obex_transport.h	2007-01-17 11:30:26.590046389 +0100
+++ openobex-anoncvs/lib/obex_transport.h	2007-01-17 11:30:45.599234389 +0100
@@ -41,18 +41,7 @@
 #include "irda_wrap.h"
 #endif /*HAVE_IRDA*/
 #ifdef HAVE_BLUETOOTH
-#ifdef HAVE_BLUETOOTH_LINUX
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#endif
-#ifdef HAVE_BLUETOOTH_FREEBSD
-#include <bluetooth.h>
-#define sockaddr_rc  sockaddr_rfcomm
-#endif
-#ifdef HAVE_BLUETOOTH_NETBSD
-#include <bluetooth.h>
-#include <netbt/rfcomm.h>
-#endif
+#include "bluez_compat.h"
 #endif /*HAVE_BLUETOOTH*/
 #ifdef HAVE_USB
 #include "usbobex.h"
@@ -66,12 +55,7 @@
 #endif /*HAVE_IRDA*/
 	struct sockaddr_in6  inet6;
 #ifdef HAVE_BLUETOOTH
-#ifdef HAVE_BLUETOOTH_LINUX
 	struct sockaddr_rc   rfcomm;
-#endif
-#ifdef HAVE_BLUETOOTH_NETBSD
-	struct sockaddr_bt   rfcomm;
-#endif
 #endif /*HAVE_BLUETOOTH*/
 #ifdef HAVE_USB
 	struct obex_usb_intf_transport_t usb;
Index: openobex-anoncvs/include/obex.h
===================================================================
--- openobex-anoncvs.orig/include/obex.h	2007-01-17 11:30:26.814060389 +0100
+++ openobex-anoncvs/include/obex.h	2007-01-17 11:30:45.627236139 +0100
@@ -55,9 +55,6 @@
 typedef void* obex_object_t;
 typedef void (*obex_event_t)(obex_t *handle, obex_object_t *obj, int mode, int event, int obex_cmd, int obex_rsp);
 // This is to workaround compilation without Bluetooth support. - Jean II
-#ifndef SOL_RFCOMM
-typedef char* bdaddr_t;
-#endif
 
 #include <openobex/obex_const.h>
 
@@ -140,8 +137,13 @@
 /*
  * Bluetooth OBEX API
  */
+#ifdef SOL_RFCOMM
+#ifdef _WIN32
+#define bdaddr_t BTH_ADDR
+#endif
 LIB_SYMBOL int BtOBEX_ServerRegister(obex_t *self, bdaddr_t *src, uint8_t channel);
 LIB_SYMBOL int BtOBEX_TransportConnect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel);
+#endif
 
 /*
  * OBEX File API
Index: openobex-anoncvs/lib/obex_main.c
===================================================================
--- openobex-anoncvs.orig/lib/obex_main.c	2007-01-17 11:30:44.071138889 +0100
+++ openobex-anoncvs/lib/obex_main.c	2007-01-17 11:30:45.651237639 +0100
@@ -45,21 +45,12 @@
 #include <sys/types.h>
 #include <stdio.h>
 
+#endif /* _WIN32 */
+
 #ifdef HAVE_BLUETOOTH
-#ifdef HAVE_BLUETOOTH_LINUX
-#include <bluetooth/bluetooth.h>
-#endif
-#ifdef HAVE_BLUETOOTH_FREEBSD
-#include <bluetooth.h>
-#define BTPROTO_RFCOMM  BLUETOOTH_PROTO_RFCOMM
-#endif
-#ifdef HAVE_BLUETOOTH_NETBSB
-#include <bluetooth.h>
-#endif
+#include "bluez_compat.h"
 #endif /*HAVE_BLUETOOTH*/
 
-#endif /* _WIN32 */
-
 #include "obex_main.h"
 #include "obex_header.h"
 #include "obex_server.h"
Index: openobex-anoncvs/apps/irxfer.c
===================================================================
--- openobex-anoncvs.orig/apps/irxfer.c	2007-01-17 11:43:09.909750889 +0100
+++ openobex-anoncvs/apps/irxfer.c	2007-01-17 11:44:55.288336639 +0100
@@ -36,6 +36,11 @@
 #include <config.h>
 #endif
 
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(sec) Sleep(1000*sec)
+#endif
+
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
Index: openobex-anoncvs/apps/obex_test_client.c
===================================================================
--- openobex-anoncvs.orig/apps/obex_test_client.c	2007-01-17 11:43:09.977755139 +0100
+++ openobex-anoncvs/apps/obex_test_client.c	2007-01-17 11:44:55.808369139 +0100
@@ -33,9 +33,15 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <libgen.h>
 #include <string.h>
 
+#ifdef _WIN32
+#warning "No implementation for basename() in win32!"
+#define basename(x) (x)
+#else
+#include <libgen.h>
+#endif
+
 #include <openobex/obex.h>
 
 #include "obex_io.h"
Index: openobex-anoncvs/apps/obex_test_cable.h
===================================================================
--- openobex-anoncvs.orig/apps/obex_test_cable.h	2007-01-17 11:43:10.041759139 +0100
+++ openobex-anoncvs/apps/obex_test_cable.h	2007-01-17 11:44:55.864372639 +0100
@@ -33,8 +33,13 @@
 
 #define CABLE_DEBUG 1
 
-
+#ifdef _WIN32
+#include <windows.h>
+#define tty_desc_t DCB
+#else
 #include <termios.h>
+#define tty_desc_t struct termios
+#endif
 
 #ifdef CABLE_DEBUG
 #define CDEBUG(format, args...) printf("%s(): " format, __FUNCTION__ , ##args)
@@ -47,7 +52,7 @@
 	const char *portname;
 	int ttyfd;
 	char inputbuf[500];
-	struct termios oldtio, newtio;
+	tty_desc_t oldtio, newtio;
 	int r320;
 };
 
Index: openobex-anoncvs/apps/obex_test_cable.c
===================================================================
--- openobex-anoncvs.orig/apps/obex_test_cable.c	2007-01-17 11:43:10.109763389 +0100
+++ openobex-anoncvs/apps/obex_test_cable.c	2007-01-17 11:44:55.924376389 +0100
@@ -35,12 +35,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
-#include <termios.h>
+
+#ifndef _WIN32
+#include <sys/ioctl.h>
+#endif
 
 #include <openobex/obex.h>
 
@@ -60,6 +62,10 @@
 //
 int cobex_do_at_cmd(struct cobex_context *gt, char *cmd, char *rspbuf, int rspbuflen, int timeout)
 {
+#ifdef _WIN32
+#warning "Implementation for win32 is missing!"
+	return -1;
+#else
 	fd_set ttyset;
 	struct timeval tv;
 	int fd;
@@ -151,6 +157,7 @@
 	strncpy(rspbuf, answer, answer_size);
 	rspbuf[answer_size] = 0;
 	return 0;
+#endif
 }
 
 //
@@ -158,6 +165,9 @@
 //
 static int cobex_init(struct cobex_context *gt)
 {
+#ifdef _WIN32
+#warning "Implementation for win32 is missing!"
+#else
 	char rspbuf[200];
 
 	CDEBUG("\n");
@@ -214,6 +224,7 @@
 		return 1;
 err:
 	cobex_cleanup(gt, TRUE);
+#endif
 	return -1;
 }
 
@@ -222,6 +233,7 @@
 //
 static void cobex_cleanup(struct cobex_context *gt, int force)
 {
+#ifndef _WIN32
 	if(force)	{
 		// Send a break to get out of OBEX-mode
 #ifdef TCSBRKP
@@ -236,6 +248,7 @@
 	}
 	close(gt->ttyfd);
 	gt->ttyfd = -1;
+#endif
 }
 
 //
Index: openobex-anoncvs/apps/obex_io.c
===================================================================
--- openobex-anoncvs.orig/apps/obex_io.c	2007-01-17 11:43:10.177767639 +0100
+++ openobex-anoncvs/apps/obex_io.c	2007-01-17 11:44:55.980379889 +0100
@@ -205,6 +205,9 @@
  *    First remove path and add "/tmp/". Then save.
  *
  */
+#ifndef DEFFILEMODE
+#define DEFFILEMODE 0
+#endif
 int safe_save_file(char *name, const uint8_t *buf, int len)
 {
 	char *s = NULL;
@@ -222,11 +225,7 @@
 		s++;
 
 	strncat(filename, s, 250);
-#ifdef _WIN32
-	fd = open(filename, O_RDWR | O_CREAT, 0);
-#else
 	fd = open(filename, O_RDWR | O_CREAT, DEFFILEMODE);
-#endif
 
 	if ( fd < 0) {
 		perror( filename);
Index: openobex-anoncvs/ircp/dirtraverse.c
===================================================================
--- openobex-anoncvs.orig/ircp/dirtraverse.c	2007-01-17 11:43:10.369779639 +0100
+++ openobex-anoncvs/ircp/dirtraverse.c	2007-01-17 11:44:56.056384639 +0100
@@ -40,7 +40,12 @@
 		}
 		else {
 			snprintf(t, MAXPATHLEN, "%s/%s", path, dirent->d_name);
+#ifdef _WIN32
+#warning "Do not use symbolic links in Windows Vista or fix this."
+			if (stat(t, &statbuf) < 0) {
+#else
 			if(lstat(t, &statbuf) < 0) {
+#endif
 				return -1;
 			}
 			else if(S_ISREG(statbuf.st_mode)) {
Index: openobex-anoncvs/ircp/ircp_io.c
===================================================================
--- openobex-anoncvs.orig/ircp/ircp_io.c	2007-01-17 11:43:10.437783889 +0100
+++ openobex-anoncvs/ircp/ircp_io.c	2007-01-17 11:44:56.100387389 +0100
@@ -115,6 +115,9 @@
 //
 // Open a file, but do some sanity-checking first.
 //
+#ifndef DEFFILEMODE
+#define DEFFILEMODE 0
+#endif
 int ircp_open_safe(const char *path, const char *name)
 {
 	char diskname[MAXPATHLEN];
@@ -169,7 +172,11 @@
 	}
 	if(flags & CD_CREATE) {
 		DEBUG(4, "Will try to create %s\n", newpath);
+#ifdef _WIN32
+		ret = _mkdir(newpath);
+#else
 		ret = mkdir(newpath, DEFFILEMODE | S_IXGRP | S_IXUSR | S_IXOTH);
+#endif
 	}
 	else {
 		ret = -1;
Index: openobex-anoncvs/apps/Makefile.am
===================================================================
--- openobex-anoncvs.orig/apps/Makefile.am	2007-01-17 11:43:10.241771639 +0100
+++ openobex-anoncvs/apps/Makefile.am	2007-01-17 11:44:56.132389389 +0100
@@ -14,9 +14,9 @@
 	obex_test_server.c obex_test_server.h \
 	obex_test_cable.c obex_test_cable.h
 
-obex_test_LDADD = $(top_builddir)/lib/libopenobex.la @BLUETOOTH_LIBS@ libmisc.a
+obex_test_LDADD = libmisc.a $(top_builddir)/lib/libopenobex.la @BLUETOOTH_LIBS@
 
-LDADD = $(top_builddir)/lib/libopenobex.la libmisc.a
+LDADD = libmisc.a $(top_builddir)/lib/libopenobex.la
 
 INCLUDES = @BLUETOOTH_CFLAGS@ -I$(top_builddir)/include
 endif
Index: openobex-anoncvs/apps/obex_test.c
===================================================================
--- openobex-anoncvs.orig/apps/obex_test.c	2007-01-17 11:43:10.305775639 +0100
+++ openobex-anoncvs/apps/obex_test.c	2007-01-17 11:44:56.164391389 +0100
@@ -44,27 +44,7 @@
 #endif /* _WIN32 */
 
 #ifdef HAVE_BLUETOOTH
-#ifdef HAVE_BLUETOOTH_LINUX
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#endif
-#ifdef HAVE_BLUETOOTH_FREEBSD
-#include <bluetooth.h>
-#define sockaddr_rc  sockaddr_rfcomm
-#define rc_family    rfcomm_family
-#define rc_bdaddr    rfcomm_bdaddr
-#define rc_channel   rfcomm_channel
-#define str2ba       bt_aton
-#endif
-#ifdef HAVE_BLUETOOTH_NETBSD
-#define rc_family    bt_family
-#define rc_bdaddr    bt_bdaddr
-#define rc_channel   bt_channel
-#define sockaddr_rc  sockaddr_bt
-#define str2ba       bt_aton
-#include <bluetooth.h>
-#include <netbt/rfcomm.h>
-#endif
+#include "../lib/bluez_compat.h"
 #endif
 
 #include <openobex/obex.h>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to