summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-11-17 18:52:36 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-11-17 18:52:36 +0100
commitba0722400127fb8f0c7156a485a0c0b4052c2020 (patch)
treea0580bac5292347a2f02ddb225eebb2caaa73f87
parentda37678acdbac0ecef6d660e90357393a9374633 (diff)
win32: fix vscclient to build with win32/mingw
-rw-r--r--vscclient.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/vscclient.c b/vscclient.c
index f8edf14..f4132f2 100644
--- a/vscclient.c
+++ b/vscclient.c
@@ -15,14 +15,19 @@
#include <string.h>
#include <unistd.h>
+#ifdef WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#endif
+#include "mutex.h"
#include "vscard_common.h"
-
#include "vreader.h"
#include "vcard_emul.h"
#include "vevent.h"
@@ -444,8 +449,8 @@ static int on_host_init(VSCMsgHeader *mhHeader, VSCMsgInit *incoming)
int num_capabilities =
1 + ((mhHeader->length - sizeof(VSCMsgInit)) / sizeof(uint32_t));
int i;
- int rv;
- pthread_t thread_id;
+ thread_status_t rv;
+ thread_t thread_id;
incoming->version = ntohl(incoming->version);
if (incoming->version != VSCARD_VERSION) {
@@ -473,7 +478,7 @@ static int on_host_init(VSCMsgHeader *mhHeader, VSCMsgInit *incoming)
);
/* launch the event_thread. This will trigger reader adds for all the
* existing readers */
- rv = pthread_create(&thread_id, NULL, event_thread, NULL);
+ rv = THREAD_CREATE(thread_id, event_thread, NULL);
if (rv < 0) {
perror("pthread_create");
return rv;