Skip to content

Commit 52d919f

Browse files
YuguoZhangYuguo Zhang
authored andcommitted
examples: build using MSVC
1 parent dde1b81 commit 52d919f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

examples/bot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
#include <stdio.h>
2121
#include <stdlib.h>
2222
#include <string.h>
23-
#include <unistd.h>
2423

2524
#ifdef _WIN32
2625
#include <conio.h>
2726
#include <ctype.h>
27+
#else
28+
#include <unistd.h>
2829
#endif
2930

3031
#include <strophe.h>

examples/complex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <stdio.h>
1414
#include <stdlib.h>
1515
#include <string.h>
16-
#include <unistd.h>
1716

1817
#ifdef _WIN32
1918
#include <conio.h>
@@ -23,6 +22,7 @@
2322
#include <iphlpapi.h>
2423
#include <mstcpip.h> /* tcp_keepalive */
2524
#else
25+
#include <unistd.h>
2626
#include <sys/socket.h>
2727
#include <netinet/in.h>
2828
#include <netinet/tcp.h>

examples/vcard.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
*/
1212

1313
#include <assert.h>
14-
#include <libgen.h> /* basename */
1514
#include <string.h>
1615
#include <stdio.h>
1716
#include <stdlib.h>
1817
#include <strophe.h>
18+
#ifndef _WIN32
19+
#include <libgen.h> /* basename */
20+
#else
21+
#define strtok_r strtok_s
22+
#define basename(x) "vcard"
23+
#endif
1924

2025
typedef struct {
2126
xmpp_ctx_t *ctx;

0 commit comments

Comments
 (0)