summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-08-07 06:15:01 +0000
committerHaibo Huang <hhb@google.com>2019-08-07 06:15:01 +0000
commitc6551bf0133303570a9ac1d625ca3ddd0051cf1c (patch)
treeaf78d43758d5cdaa759549f502c4cc86907f6d8d /lldb
parent02b8056cc1ace66ddc8c00c064838d11ab2f9742 (diff)
downloadbcm5719-llvm-c6551bf0133303570a9ac1d625ca3ddd0051cf1c.tar.gz
bcm5719-llvm-c6551bf0133303570a9ac1d625ca3ddd0051cf1c.zip
Detect HAVE_SYS_TYPES_H in lldb
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
Diffstat (limited to 'lldb')
-rw-r--r--lldb/cmake/modules/LLDBGenerateConfig.cmake1
-rw-r--r--lldb/include/lldb/Host/Config.h.cmake2
-rw-r--r--lldb/include/lldb/Host/windows/PosixApi.h5
-rw-r--r--lldb/source/Expression/UserExpression.cpp2
-rw-r--r--lldb/source/Expression/UtilityFunction.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp2
-rw-r--r--lldb/tools/driver/Platform.h2
8 files changed, 16 insertions, 2 deletions
diff --git a/lldb/cmake/modules/LLDBGenerateConfig.cmake b/lldb/cmake/modules/LLDBGenerateConfig.cmake
index 33b7e98318e..119021c587b 100644
--- a/lldb/cmake/modules/LLDBGenerateConfig.cmake
+++ b/lldb/cmake/modules/LLDBGenerateConfig.cmake
@@ -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)
diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
index b8fb9e9de86..7f152437fe5 100644
--- a/lldb/include/lldb/Host/Config.h.cmake
+++ b/lldb/include/lldb/Host/Config.h.cmake
@@ -19,6 +19,8 @@
#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
+#cmakedefine01 HAVE_SYS_TYPES_H
+
#cmakedefine01 HAVE_SYS_EVENT_H
#cmakedefine01 HAVE_PPOLL
diff --git a/lldb/include/lldb/Host/windows/PosixApi.h b/lldb/include/lldb/Host/windows/PosixApi.h
index aab09e1222f..6a6ed3ebd61 100644
--- a/lldb/include/lldb/Host/windows/PosixApi.h
+++ b/lldb/include/lldb/Host/windows/PosixApi.h
@@ -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!"
@@ -45,14 +46,14 @@
#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
diff --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp
index ea54cec7b1f..e2d1d2f2b3d 100644
--- a/lldb/source/Expression/UserExpression.cpp
+++ b/lldb/source/Expression/UserExpression.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
+
#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/lldb/source/Expression/UtilityFunction.cpp b/lldb/source/Expression/UtilityFunction.cpp
index eeaeca18da8..aac8b33a6bf 100644
--- a/lldb/source/Expression/UtilityFunction.cpp
+++ b/lldb/source/Expression/UtilityFunction.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
+
#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 91f333fc026..54d852b2d83 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
+
#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index 5eec224477f..564c62c6a2c 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
+
#include "ClangUtilityFunction.h"
#include "ClangExpressionDeclMap.h"
#include "ClangExpressionParser.h"
diff --git a/lldb/tools/driver/Platform.h b/lldb/tools/driver/Platform.h
index aeb8cc97fcc..cf6c4ec8e14 100644
--- a/lldb/tools/driver/Platform.h
+++ b/lldb/tools/driver/Platform.h
@@ -9,6 +9,8 @@
#ifndef lldb_Platform_h_
#define lldb_Platform_h_
+#include "lldb/Host/Config.h"
+
#if defined(_WIN32)
#include <io.h>
OpenPOWER on IntegriCloud