Hi,
This patch fixes (again) compiling on win32. Tested with MSVC7/8/9 and
with gcc on linux.
HS
--
MSVC doesn't like define that are use like normal variables, e.g. as
argument to memcmp(). This patch makes the define an initializer and
adds a const variable.
---
lib/usbobex.c | 3 ++-
lib/usbobex.h | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/usbobex.c b/lib/usbobex.c
index 3d1f619..b12131b 100644
--- a/lib/usbobex.c
+++ b/lib/usbobex.c
@@ -242,10 +242,11 @@ static void find_obex_service_descriptor(unsigned char
*buffer, int buflen, obex
else if (*service == NULL) {
*service =
malloc(sizeof(obex_usb_intf_service_t));
if (*service != NULL) {
+ const uint8_t default_uuid[16] =
WMC_DEFAULT_OBEX_SERVER_UUID;
(*service)->role = buffer[3];
memcpy((*service)->uuid, buffer+4, 16);
(*service)->version =
(buffer[20]<<8)|(buffer[21]);
- if (memcmp((*service)->uuid,
WMC_DEFAULT_OBEX_SERVER_UUID, 16) == 0 )
+ if (memcmp((*service)->uuid,
default_uuid, 16) == 0 )
(*service)->is_default_uuid = 1;
else
(*service)->is_default_uuid = 0;
diff --git a/lib/usbobex.h b/lib/usbobex.h
index f3ffbd4..efd7a38 100644
--- a/lib/usbobex.h
+++ b/lib/usbobex.h
@@ -82,11 +82,11 @@ struct cdc_union_desc {
#define USB_DT_CS_INTERFACE 0x24
#define CDC_DATA_INTERFACE_TYPE 0x0a
-#define WMC_DEFAULT_OBEX_SERVER_UUID ((const uint8_t []) \
+#define WMC_DEFAULT_OBEX_SERVER_UUID \
{ 0x02, 0xae, 0xb3, 0x20, \
0xf6, 0x49, 0x11, 0xda, \
0x97, 0x4d, 0x08, 0x00, \
-0x20, 0x0c, 0x9a, 0x66 } )
+0x20, 0x0c, 0x9a, 0x66 }
#define USB_MAX_STRING_SIZE 256
#define USB_OBEX_TIMEOUT 10000 /* 10 seconds */
--
1.5.6.5
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users