Skip to content

Commit e9b207c

Browse files
Update platform.hpp
oopsie...
1 parent 7a6e984 commit e9b207c

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

src/utils/platform.hpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
#pragma once
22

33
#ifdef _WIN32
4+
// Prevent old winsock.h from being included anywhere
5+
#ifndef _WINSOCKAPI_
6+
#define _WINSOCKAPI_
7+
#endif
8+
9+
// Configure Windows headers
10+
#ifndef WIN32_LEAN_AND_MEAN
411
#define WIN32_LEAN_AND_MEAN
12+
#endif
13+
#ifndef NOMINMAX
14+
#define NOMINMAX
15+
#endif
16+
17+
// Include networking headers in correct order
518
#include <winsock2.h>
619
#include <ws2tcpip.h>
20+
21+
// Now windows.h won't include winsock.h
22+
#include <windows.h>
23+
724
#pragma comment(lib, "ws2_32.lib")
825
typedef int socklen_t;
926
#define CLOSE_SOCKET closesocket
@@ -14,11 +31,3 @@ typedef int socklen_t;
1431
#include <unistd.h>
1532
#define CLOSE_SOCKET close
1633
#endif
17-
18-
// PSMoveAPI compatibility - only define what's not in the main headers
19-
#ifndef PSMOVE_BTADDR_SIZE
20-
#define PSMOVE_BTADDR_SIZE 6
21-
typedef struct {
22-
unsigned char data[PSMOVE_BTADDR_SIZE];
23-
} PSMove_Data_BTAddr;
24-
#endif

0 commit comments

Comments
 (0)