Skip to content

Commit 51ce6c4

Browse files
committed
[lldb-dap] Fix error C2065: 'PATH_MAX': undeclared identifier
This should fix the Windows build.
1 parent 9638d08 commit 51ce6c4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lldb/tools/lldb-dap/EventHelper.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
#include "LLDBUtils.h"
1313
#include "lldb/API/SBFileSpec.h"
1414

15+
#if defined(_WIN32)
16+
#define NOMINMAX
17+
#include <windows.h>
18+
19+
#ifndef PATH_MAX
20+
#define PATH_MAX MAX_PATH
21+
#endif
22+
#endif
23+
1524
namespace lldb_dap {
1625

1726
static void SendThreadExitedEvent(DAP &dap, lldb::tid_t tid) {

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#include <windows.h>
8181
#undef GetObject
8282
#include <io.h>
83+
typedef int socklen_t;
8384
#else
8485
#include <netinet/in.h>
8586
#include <sys/socket.h>
@@ -91,13 +92,6 @@
9192
#include <sys/prctl.h>
9293
#endif
9394

94-
#if defined(_WIN32)
95-
#ifndef PATH_MAX
96-
#define PATH_MAX MAX_PATH
97-
#endif
98-
typedef int socklen_t;
99-
#endif
100-
10195
using namespace lldb_dap;
10296
using lldb_private::NativeSocket;
10397
using lldb_private::Socket;

0 commit comments

Comments
 (0)