[all-commits] [llvm/llvm-project] f70b22: [LLDB] Define _BSD_SOURCE globally, to get optrese...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Thu Dec 21 14:40:25 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f70b229e9643ddb895d491b62a5ec0655917f6f8
      https://github.com/llvm/llvm-project/commit/f70b229e9643ddb895d491b62a5ec0655917f6f8
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-12-22 (Fri, 22 Dec 2023)

  Changed paths:
    M lldb/CMakeLists.txt
    M lldb/include/lldb/Host/HostGetOpt.h

  Log Message:
  -----------
  [LLDB] Define _BSD_SOURCE globally, to get optreset available in mingw's getopt.h (#76137)

We previously were defining _BSD_SOURCE right before including getopt.h.
However, on mingw-w64, getopt.h is also transitively included by
unistd.h, and unistd.h can be transitively included by many headers
(recently, by some libc++ headers).

Therefore, to be safe, we need to define _BSD_SOURCE before including
any header. Thus do this in CMake.

This fixes https://github.com/llvm/llvm-project/issues/76050.




More information about the All-commits mailing list