Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/bot.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#ifdef _WIN32
#include <conio.h>
#include <ctype.h>
#else
#include <unistd.h>
#endif

#include <strophe.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#ifdef _WIN32
#include <conio.h>
Expand All @@ -23,6 +22,7 @@
#include <iphlpapi.h>
#include <mstcpip.h> /* tcp_keepalive */
#else
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
Expand Down
7 changes: 6 additions & 1 deletion examples/vcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
*/

#include <assert.h>
#include <libgen.h> /* basename */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <strophe.h>
#ifndef _WIN32
#include <libgen.h> /* basename */
#else
#define strtok_r strtok_s
#define basename(x) "vcard"
#endif

typedef struct {
xmpp_ctx_t *ctx;
Expand Down
7 changes: 5 additions & 2 deletions src/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include <errno.h>

#include "common.h"
#ifdef _MSC_VER
#define strcasecmp _stricmp
#endif

#ifndef STROPHE_COMPRESSION_BUFFER_SIZE
/** Max buffer size for compressed data (send & receive). */
Expand Down Expand Up @@ -110,7 +113,7 @@ static int
_compression_write(xmpp_conn_t *conn, const void *buff, size_t len, int flush)
{
int ret;
const void *buff_end = buff + len;
const void *buff_end = (const char *)buff + len;
struct xmpp_compression *comp = conn->compression.state;
comp->compression.stream.next_in = (Bytef *)buff;
comp->compression.stream.avail_in = len;
Expand Down Expand Up @@ -201,7 +204,7 @@ static void *_zlib_alloc(void *opaque, unsigned int items, unsigned int size)
static void _init_zlib_compression(xmpp_ctx_t *ctx, struct zlib_compression *s)
{
s->buffer = strophe_alloc(ctx, STROPHE_COMPRESSION_BUFFER_SIZE);
s->buffer_end = s->buffer + STROPHE_COMPRESSION_BUFFER_SIZE;
s->buffer_end = (char *)s->buffer + STROPHE_COMPRESSION_BUFFER_SIZE;

s->stream.opaque = ctx;
s->stream.zalloc = _zlib_alloc;
Expand Down
2 changes: 2 additions & 0 deletions src/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*/

#include <errno.h>
#ifndef _MSC_VER
#include <netinet/in.h>
#endif
#include <stdarg.h>
#include <string.h>
#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion src/resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ resolver_win32_srv_query(const char *fulldomain, unsigned char *buf, size_t len)
insize = recvfrom(sock, (char *)buf, (int)len, 0,
(struct sockaddr *)&dnsaddr, &addrlen);
if (insize == SOCKET_ERROR) {
if (sock_error() == WSAEWOULDBLOCK) {
if (sock_error(NULL) == WSAEWOULDBLOCK) {
Sleep(100);
} else {
break;
Expand Down
4 changes: 4 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include "strophe.h"

#include "common.h"
#ifdef _MSC_VER
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

const struct conn_interface tls_intf = {
tls_read,
Expand Down
2 changes: 1 addition & 1 deletion src/tls_schannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ int tls_start(tls_t *tls)

/* use the domain there as our name */
name = tls->conn->domain;
intf = tls->conn->intf;
intf = &tls->conn->intf;

ctxtreq = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR |
Expand Down