[Lldb-commits] [lldb] 51ce6c4 - [lldb-dap] Fix error C2065: 'PATH_MAX': undeclared identifier

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 24 10:16:10 PST 2025


Author: Jonas Devlieghere
Date: 2025-02-24T12:16:05-06:00
New Revision: 51ce6c437fec1fe0170d077424e1cbc141d05c2b

URL: https://github.com/llvm/llvm-project/commit/51ce6c437fec1fe0170d077424e1cbc141d05c2b
DIFF: https://github.com/llvm/llvm-project/commit/51ce6c437fec1fe0170d077424e1cbc141d05c2b.diff

LOG: [lldb-dap] Fix error C2065: 'PATH_MAX': undeclared identifier

This should fix the Windows build.

Added: 
    

Modified: 
    lldb/tools/lldb-dap/EventHelper.cpp
    lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-dap/EventHelper.cpp b/lldb/tools/lldb-dap/EventHelper.cpp
index 20845fbc5b916..705eb0a457d9c 100644
--- a/lldb/tools/lldb-dap/EventHelper.cpp
+++ b/lldb/tools/lldb-dap/EventHelper.cpp
@@ -12,6 +12,15 @@
 #include "LLDBUtils.h"
 #include "lldb/API/SBFileSpec.h"
 
+#if defined(_WIN32)
+#define NOMINMAX
+#include <windows.h>
+
+#ifndef PATH_MAX
+#define PATH_MAX MAX_PATH
+#endif
+#endif
+
 namespace lldb_dap {
 
 static void SendThreadExitedEvent(DAP &dap, lldb::tid_t tid) {

diff  --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index fcefb4137f227..7935e88dba71a 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -80,6 +80,7 @@
 #include <windows.h>
 #undef GetObject
 #include <io.h>
+typedef int socklen_t;
 #else
 #include <netinet/in.h>
 #include <sys/socket.h>
@@ -91,13 +92,6 @@
 #include <sys/prctl.h>
 #endif
 
-#if defined(_WIN32)
-#ifndef PATH_MAX
-#define PATH_MAX MAX_PATH
-#endif
-typedef int socklen_t;
-#endif
-
 using namespace lldb_dap;
 using lldb_private::NativeSocket;
 using lldb_private::Socket;


        


More information about the lldb-commits mailing list