aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-16 01:09:37 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-16 01:09:37 -0800
commit70d65fed3a230dcf17939786b5ac941423e29216 (patch)
treeab929f1960778dbfbc56a859f7caf3c689adc391
parent39dbff5615631522d3ef98b83141957038502c0d (diff)
downloadnng-70d65fed3a230dcf17939786b5ac941423e29216.tar.gz
nng-70d65fed3a230dcf17939786b5ac941423e29216.tar.bz2
nng-70d65fed3a230dcf17939786b5ac941423e29216.zip
Fixes for 32-bit Windows compilation.
-rw-r--r--.appveyor.yml10
-rw-r--r--src/platform/windows/win_clock.c2
-rw-r--r--src/platform/windows/win_impl.h2
-rw-r--r--src/platform/windows/win_net.c4
-rw-r--r--src/platform/windows/win_thread.c2
-rw-r--r--src/transport/ipc/ipc.c2
-rw-r--r--src/transport/tcp/tcp.c2
-rw-r--r--tests/trantest.h2
8 files changed, 11 insertions, 15 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 92ce4e8f..4979b62b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -5,21 +5,17 @@ environment:
CFLAGS: /MP
matrix:
# array of all environments used to test builds
+ # Note that we require relatively modern Visual Studio, in order to pick
+ # up snprintf. You don't want the older versions of VS, really!
- GENERATOR: NMake Makefiles
CFG: Debug
- VS_VERSION: 12.0
+ VS_VERSION: 14.0
- GENERATOR: Visual Studio 14 2015
VS_VERSION: 14.0
CFG: Debug
- - GENERATOR: Visual Studio 12 2013
- VS_VERSION: 12.0
- CFG: Debug
- GENERATOR: Visual Studio 14 2015 Win64
CFG: Debug
VS_VERSION: 14.0
- - GENERATOR: Visual Studio 12 2013 Win64
- CFG: Debug
- VS_VERSION: 12.0
cache:
- '%USERPROFILE%\asciidoctor-%ASCIIDOCTOR_VER%.gem -> .appveyor.yml'
diff --git a/src/platform/windows/win_clock.c b/src/platform/windows/win_clock.c
index d0d2e7ca..6cf191ee 100644
--- a/src/platform/windows/win_clock.c
+++ b/src/platform/windows/win_clock.c
@@ -22,7 +22,7 @@ nni_plat_clock(void)
void
nni_plat_usleep(nni_duration usec)
{
- Sleep((DWORD)((usec + 999) / 1000));
+ Sleep((DWORD) ((usec + 999) / 1000));
}
diff --git a/src/platform/windows/win_impl.h b/src/platform/windows/win_impl.h
index c3afef91..9de47ce4 100644
--- a/src/platform/windows/win_impl.h
+++ b/src/platform/windows/win_impl.h
@@ -52,7 +52,7 @@ struct nni_plat_ipcsock {
};
struct nni_plat_thr {
- void (__stdcall *func)(void *);
+ void (*func)(void *);
void * arg;
HANDLE handle;
};
diff --git a/src/platform/windows/win_net.c b/src/platform/windows/win_net.c
index 060324eb..36390053 100644
--- a/src/platform/windows/win_net.c
+++ b/src/platform/windows/win_net.c
@@ -201,7 +201,7 @@ nni_plat_tcp_send(nni_plat_tcpsock *s, nni_iov *iovs, int cnt)
for (i = 0, resid = 0; i < cnt; resid += iov[i].len, i++) {
iov[i].buf = iovs[i].iov_buf;
- iov[i].len = (DWORD)iovs[i].iov_len;
+ iov[i].len = (DWORD) iovs[i].iov_len;
}
i = 0;
@@ -257,7 +257,7 @@ nni_plat_tcp_recv(nni_plat_tcpsock *s, nni_iov *iovs, int cnt)
for (i = 0, resid = 0; i < cnt; resid += iov[i].len, i++) {
iov[i].buf = iovs[i].iov_buf;
- iov[i].len = (DWORD)iovs[i].iov_len;
+ iov[i].len = (DWORD) iovs[i].iov_len;
}
i = 0;
diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c
index ef4859d6..e2568626 100644
--- a/src/platform/windows/win_thread.c
+++ b/src/platform/windows/win_thread.c
@@ -95,7 +95,7 @@ nni_plat_cv_until(nni_plat_cv *cv, nni_time until)
msec = 0;
} else {
// times are in usec, but win32 wants millis
- msec = (DWORD)(((until - now) + 999)/1000);
+ msec = (DWORD) (((until - now) + 999)/1000);
}
ok = SleepConditionVariableCS(&cv->cv, cv->cs, msec);
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c
index 4f1a5afa..3aef5363 100644
--- a/src/transport/ipc/ipc.c
+++ b/src/transport/ipc/ipc.c
@@ -126,7 +126,7 @@ nni_ipc_pipe_recv(void *arg, nni_msg **msgp)
return (NNG_EPROTO);
}
- if ((rv = nng_msg_alloc(&msg, len)) != 0) {
+ if ((rv = nng_msg_alloc(&msg, (size_t) len)) != 0) {
return (rv);
}
diff --git a/src/transport/tcp/tcp.c b/src/transport/tcp/tcp.c
index 6c085388..09a2b385 100644
--- a/src/transport/tcp/tcp.c
+++ b/src/transport/tcp/tcp.c
@@ -115,7 +115,7 @@ nni_tcp_pipe_recv(void *arg, nni_msg **msgp)
return (NNG_EPROTO);
}
- if ((rv = nng_msg_alloc(&msg, len)) != 0) {
+ if ((rv = nng_msg_alloc(&msg, (size_t) len)) != 0) {
return (rv);
}
diff --git a/tests/trantest.h b/tests/trantest.h
index bd458d21..6956c1fe 100644
--- a/tests/trantest.h
+++ b/tests/trantest.h
@@ -45,7 +45,7 @@ void
trantest_scheme(trantest *tt)
{
Convey("Scheme is correct", {
- int l = strlen(tt->tran->tran_scheme);
+ size_t l = strlen(tt->tran->tran_scheme);
So(strncmp(tt->addr, tt->tran->tran_scheme, l) == 0);
So(strncmp(tt->addr + l, "://", 3) == 0);
})