Detect HAVE_SYS_TYPES_H in lldb
authorHaibo Huang <hhb@google.com>
Wed, 7 Aug 2019 06:15:01 +0000 (06:15 +0000)
committerHaibo Huang <hhb@google.com>
Wed, 7 Aug 2019 06:15:01 +0000 (06:15 +0000)
Summary:
After rL368069 I noticed that HAVE_SYS_TYPES_H is not defined in
Platform.h, or anywhere else in lldb. This change fixes that.

Reviewers: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D65822

llvm-svn: 368125

lldb/cmake/modules/LLDBGenerateConfig.cmake
lldb/include/lldb/Host/Config.h.cmake
lldb/include/lldb/Host/windows/PosixApi.h
lldb/source/Expression/UserExpression.cpp
lldb/source/Expression/UtilityFunction.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
lldb/tools/driver/Platform.h

index 33b7e98318e0ff4081df43661d17362e12af554d..119021c587b85cb9b78d9e53562d9d0ae83ea301 100644 (file)
@@ -12,6 +12,7 @@ check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
 check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
 
 check_include_file(termios.h HAVE_TERMIOS_H)
+check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
 check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
 
 check_cxx_symbol_exists(process_vm_readv "sys/uio.h" HAVE_PROCESS_VM_READV)
index b8fb9e9de868d939e434e7753629fa2aec9308eb..7f152437fe5280f42af4b1f233d2edc25cbdee3f 100644 (file)
@@ -19,6 +19,8 @@
 
 #define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
 
+#cmakedefine01 HAVE_SYS_TYPES_H
+
 #cmakedefine01 HAVE_SYS_EVENT_H
 
 #cmakedefine01 HAVE_PPOLL
index aab09e1222f545bfa33a4092377da66347c6ea0d..6a6ed3ebd61e97deb5ca53a34d2812d4827ec58c 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef liblldb_Host_windows_PosixApi_h
 #define liblldb_Host_windows_PosixApi_h
 
+#include "lldb/Host/Config.h"
 #include "llvm/Support/Compiler.h"
 #if !defined(_WIN32)
 #error "windows/PosixApi.h being #included on non Windows system!"
 #define S_IRWXG 0
 #define S_IRWXO 0
 
-#ifdef __MINGW32__
+#if HAVE_SYS_TYPES_H
 // 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__
+#endif // HAVE_SYS_TYPES_H
 
 #ifdef _MSC_VER
 
index ea54cec7b1f57d011f9ca8dd0bf5ab2304c81ab1..e2d1d2f2b3d2fd7cc3a4c27919cb20ef6a6c4744 100644 (file)
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/Host/Config.h"
+
 #include <stdio.h>
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
index eeaeca18da868be6f1439421fa522e43f6761763..aac8b33a6bfa8ac2d799bf548ac138988354a6b9 100644 (file)
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/Host/Config.h"
+
 #include <stdio.h>
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
index 91f333fc0265e0d3016a4ab155b40f3bcdfe3d34..54d852b2d8393827a17431fbf6bfa2628d58bd69 100644 (file)
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/Host/Config.h"
+
 #include <stdio.h>
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
index 5eec224477fcbf2c8a4d6aec140f31baa62bcb3b..564c62c6a2c695ed7cbe6fc06cc6c7d6e901ebf5 100644 (file)
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/Host/Config.h"
+
 #include "ClangUtilityFunction.h"
 #include "ClangExpressionDeclMap.h"
 #include "ClangExpressionParser.h"
index aeb8cc97fcca42dd34533e95727f108b4da19c2d..cf6c4ec8e1468da2a2108049c4bdd4dc6e932fef 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef lldb_Platform_h_
 #define lldb_Platform_h_
 
+#include "lldb/Host/Config.h"
+
 #if defined(_WIN32)
 
 #include <io.h>