Skip to content

Commit

Permalink
Detect HAVE_SYS_TYPES_H in lldb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hhb committed Aug 7, 2019
1 parent 02b8056 commit c6551bf
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions lldb/cmake/modules/LLDBGenerateConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lldb/include/lldb/Host/Config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"

#cmakedefine01 HAVE_SYS_TYPES_H

#cmakedefine01 HAVE_SYS_EVENT_H

#cmakedefine01 HAVE_PPOLL
Expand Down
5 changes: 3 additions & 2 deletions lldb/include/lldb/Host/windows/PosixApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions lldb/source/Expression/UserExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/Config.h"

#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
Expand Down
2 changes: 2 additions & 0 deletions lldb/source/Expression/UtilityFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/Config.h"

#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/Config.h"

#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/Config.h"

#include "ClangUtilityFunction.h"
#include "ClangExpressionDeclMap.h"
#include "ClangExpressionParser.h"
Expand Down
2 changes: 2 additions & 0 deletions lldb/tools/driver/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef lldb_Platform_h_
#define lldb_Platform_h_

#include "lldb/Host/Config.h"

#if defined(_WIN32)

#include <io.h>
Expand Down

0 comments on commit c6551bf

Please sign in to comment.