hhb created this revision. Herald added subscribers: lldb-commits, mstorsjo. Herald added a project: LLDB.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D65691 Files: lldb/include/lldb/Host/windows/PosixApi.h lldb/source/Host/windows/FileSystem.cpp lldb/source/Initialization/SystemInitializerCommon.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/tools/driver/Platform.h lldb/tools/lldb-vscode/VSCode.cpp lldb/tools/lldb-vscode/lldb-vscode.cpp
Index: lldb/tools/lldb-vscode/lldb-vscode.cpp =================================================================== --- lldb/tools/lldb-vscode/lldb-vscode.cpp +++ lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -50,7 +50,9 @@ #include "VSCode.h" #if defined(_WIN32) +#ifndef PATH_MAX #define PATH_MAX MAX_PATH +#endif typedef int socklen_t; constexpr const char *dev_null_path = "nul"; Index: lldb/tools/lldb-vscode/VSCode.cpp =================================================================== --- lldb/tools/lldb-vscode/VSCode.cpp +++ lldb/tools/lldb-vscode/VSCode.cpp @@ -16,7 +16,9 @@ #if defined(_WIN32) #define NOMINMAX +#ifndef __MINGW32__ #include <Windows.h> +#endif // __MINGW32__ #include <fcntl.h> #include <io.h> #endif Index: lldb/tools/driver/Platform.h =================================================================== --- lldb/tools/driver/Platform.h +++ lldb/tools/driver/Platform.h @@ -15,6 +15,10 @@ #if defined(_MSC_VER) #include <signal.h> #endif +#if defined(__MINGW32__) +// pid_t +#include <sys/types.h> +#endif #include "lldb/Host/windows/windows.h" #include <inttypes.h> Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -16,6 +16,10 @@ #include <sys/socket.h> #include <unistd.h> #endif +#ifdef __MINGW32__ +// usleep +#include <unistd.h> +#endif #include <sys/stat.h> #include <sys/types.h> #include <time.h> Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -16,6 +16,11 @@ #include <mutex> #include <sstream> +#ifdef __MINGW32__ +// usleep +#include <unistd.h> +#endif + #include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" Index: lldb/source/Initialization/SystemInitializerCommon.cpp =================================================================== --- lldb/source/Initialization/SystemInitializerCommon.cpp +++ lldb/source/Initialization/SystemInitializerCommon.cpp @@ -25,6 +25,8 @@ #if defined(_WIN32) #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h" #include "lldb/Host/windows/windows.h" +// for _CrtSetReportMode +#include <crtdbg.h> #endif #include "llvm/Support/TargetSelect.h" Index: lldb/source/Host/windows/FileSystem.cpp =================================================================== --- lldb/source/Host/windows/FileSystem.cpp +++ lldb/source/Host/windows/FileSystem.cpp @@ -12,6 +12,9 @@ #include <sys/stat.h> #include <sys/types.h> +// For _SH_* +#include <share.h> + #include "lldb/Host/FileSystem.h" #include "lldb/Host/windows/AutoHandle.h" #include "lldb/Host/windows/PosixApi.h" Index: lldb/include/lldb/Host/windows/PosixApi.h =================================================================== --- lldb/include/lldb/Host/windows/PosixApi.h +++ lldb/include/lldb/Host/windows/PosixApi.h @@ -45,6 +45,15 @@ #define S_IRWXG 0 #define S_IRWXO 0 +#ifdef __MINGW32__ +// pyconfig.h typedefs this. We require python headers to be included before +// any LLDB headers, but there's no way to prevent python's pid_t definition +// from leaking, so this is the best option. +#ifndef NO_PID_T +#include <sys/types.h> +#endif +#endif // __MINGW32__ + #ifdef _MSC_VER // PRIxxx format macros for printf() @@ -80,6 +89,8 @@ char *strcasestr(const char *s, const char *find); char *realpath(const char *name, char *resolved); +#ifdef _MSC_VER + int usleep(uint32_t useconds); char *basename(char *path); char *dirname(char *path); @@ -87,6 +98,8 @@ int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t n); +#endif // _MSC_VER + // empty functions inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits