Skip to content

Commit

Permalink
2 more winsock.h includes, also set PRIu64 for mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Jun 13, 2020
1 parent 8cfc45b commit a11c699
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 9 additions & 2 deletions windows/JackTypes_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@
#ifndef __JackTypes_WIN32__
#define __JackTypes_WIN32__

#ifdef __MINGW32__
#include <winsock2.h>
#endif
#include <windows.h>

typedef ULONGLONG UInt64;
typedef ULONGLONG UInt64;
typedef UInt64 uint64_t;
typedef unsigned short uint16_t;
typedef DWORD jack_tls_key;
typedef DWORD jack_tls_key;

#if defined(__MINGW32__)
#define PRIu64 "llu"
#endif

#endif

11 changes: 7 additions & 4 deletions windows/JackWinMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

#include "JackCompilerDeps.h"
#include "JackException.h"
#ifdef __MINGW32__
#include <winsock2.h>
#endif
#include <windows.h>
#include <stdio.h>

Expand Down Expand Up @@ -71,13 +74,13 @@ class SERVER_EXPORT JackWinMutex

JackWinMutex(const char* name = NULL)
{
// In recursive mode by default
// In recursive mode by default
if (name) {
char buffer[MAX_PATH];
snprintf(buffer, sizeof(buffer), "%s_%s", "JackWinMutex", name);
fMutex = CreateMutex(NULL, FALSE, buffer);
} else {
fMutex = CreateMutex(NULL, FALSE, NULL);
fMutex = CreateMutex(NULL, FALSE, buffer);
} else {
fMutex = CreateMutex(NULL, FALSE, NULL);
}

ThrowIf((fMutex == 0), JackException("JackWinMutex: could not init the mutex"));
Expand Down

0 comments on commit a11c699

Please sign in to comment.