Skip to content

Commit d5fcf07

Browse files
authored
Fix more build errors on win32/mingw (#270)
1 parent 9adc83a commit d5fcf07

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

trantor/net/InetAddress.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ std::string InetAddress::toIpPortNetEndian() const
123123
std::string buf;
124124
static constexpr auto bytes = sizeof(addr_.sin_port);
125125
buf.resize(bytes);
126-
#if defined _MSC_VER && _MSC_VER >= 1900
126+
#if defined _WIN32
127127
std::memcpy((PVOID)&buf[0], (PVOID)&addr_.sin_port, bytes);
128128
#else
129129
std::memcpy(&buf[0], &addr_.sin_port, bytes);
@@ -201,15 +201,15 @@ std::string InetAddress::toIp() const
201201
char buf[64];
202202
if (addr_.sin_family == AF_INET)
203203
{
204-
#if defined _MSC_VER && _MSC_VER >= 1900
204+
#if defined _WIN32
205205
::inet_ntop(AF_INET, (PVOID)&addr_.sin_addr, buf, sizeof(buf));
206206
#else
207207
::inet_ntop(AF_INET, &addr_.sin_addr, buf, sizeof(buf));
208208
#endif
209209
}
210210
else if (addr_.sin_family == AF_INET6)
211211
{
212-
#if defined _MSC_VER && _MSC_VER >= 1900
212+
#if defined _WIN32
213213
::inet_ntop(AF_INET6, (PVOID)&addr6_.sin6_addr, buf, sizeof(buf));
214214
#else
215215
::inet_ntop(AF_INET6, &addr6_.sin6_addr, buf, sizeof(buf));
@@ -226,7 +226,7 @@ std::string InetAddress::toIpNetEndian() const
226226
{
227227
static constexpr auto bytes = sizeof(addr_.sin_addr.s_addr);
228228
buf.resize(bytes);
229-
#if defined _MSC_VER && _MSC_VER >= 1900
229+
#if defined _WIN32
230230
std::memcpy((PVOID)&buf[0], (PVOID)&addr_.sin_addr.s_addr, bytes);
231231
#else
232232
std::memcpy(&buf[0], &addr_.sin_addr.s_addr, bytes);
@@ -236,7 +236,7 @@ std::string InetAddress::toIpNetEndian() const
236236
{
237237
static constexpr auto bytes = sizeof(addr6_.sin6_addr);
238238
buf.resize(bytes);
239-
#if defined _MSC_VER && _MSC_VER >= 1900
239+
#if defined _WIN32
240240
std::memcpy((PVOID)&buf[0], (PVOID)ip6NetEndian(), bytes);
241241
#else
242242
std::memcpy(&buf[0], ip6NetEndian(), bytes);

trantor/utils/crypto/sha256.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define SIG1(x) (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))
3030

3131
/**************************** VARIABLES *****************************/
32-
static const WORD k[64] = {
32+
static const unsigned int k[64] = {
3333
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
3434
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
3535
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,

0 commit comments

Comments
 (0)