#include <malloc.h> // nolint
void* aligned_malloc(size_t size, size_t align) {
- return _aligned_malloc(size, alignment);
+ return _aligned_malloc(size, align);
}
void aligned_free(void* aligned_ptr) {
template <>
struct hash<pthread_t> {
std::size_t operator()(const pthread_t& k) const {
- return 0 ^ std::hash<decltype(k.p)>(k.p) ^ std::hash<decltype(k.x)>(k.x);
+ return 0 ^ std::hash<decltype(k.p)>()(k.p) ^
+ std::hash<decltype(k.x)>()(k.x);
}
};
}
DWORD bytesReceived;
int res = WSARecvMsg(h, &msg, &bytesReceived, nullptr, nullptr);
- return res == o ? (ssize_t)bytesReceived : -1;
+ return res == 0 ? (ssize_t)bytesReceived : -1;
}
ssize_t send(int s, const void* buf, size_t len, int flags) {
}
#elif defined(_WIN32)
#include <errno.h>
+#include <locale.h>
#include <stdint.h>
#include <stdlib.h>
char* ctime_r(const time_t* t, char* buf) {
char tmpBuf[64];
- if (ctime_s(tmpBuf, t)) {
+ if (ctime_s(tmpBuf, 64, t)) {
return nullptr;
}
// Nothing we can do if the buff is to small :(
}
int nanosleep(const struct timespec* request, struct timespec* remain) {
- Sleep((DWORD)((request->tv_sec * 1000) + (request->tv_nsec / 1000000));
+ Sleep((DWORD)((request->tv_sec * 1000) + (request->tv_nsec / 1000000)));
remain->tv_nsec = 0;
remain->tv_sec = 0;
return 0;