[libunwind] c1a4424 - [libunwind] Move errno.h and signal.h includes under the block where they're needed (#78054)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 07:31:05 PST 2024


Author: Louis Dionne
Date: 2024-01-16T10:31:01-05:00
New Revision: c1a442462d9d47f86392da7e7019ab218d7a3088

URL: https://github.com/llvm/llvm-project/commit/c1a442462d9d47f86392da7e7019ab218d7a3088
DIFF: https://github.com/llvm/llvm-project/commit/c1a442462d9d47f86392da7e7019ab218d7a3088.diff

LOG: [libunwind] Move errno.h and signal.h includes under the block where they're needed (#78054)

Commit fc1c478709e3 added includes of <signal.h> and <errno.h> to
UnwindCursor.hpp. The library previously built on platforms where these
headers are not provided. These headers should be included only in the
case where they are actually needed, i.e. on Linux.

Added: 
    

Modified: 
    libunwind/src/UnwindCursor.hpp

Removed: 
    


################################################################################
diff  --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 8517d328bd058b..7753936a5894a3 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -12,8 +12,6 @@
 #define __UNWINDCURSOR_HPP__
 
 #include "cet_unwind.h"
-#include <errno.h>
-#include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -35,6 +33,8 @@
 #if defined(_LIBUNWIND_TARGET_LINUX) &&                                        \
     (defined(_LIBUNWIND_TARGET_AARCH64) || defined(_LIBUNWIND_TARGET_RISCV) || \
      defined(_LIBUNWIND_TARGET_S390X))
+#include <errno.h>
+#include <signal.h>
 #include <sys/syscall.h>
 #include <sys/uio.h>
 #include <unistd.h>


        


More information about the cfe-commits mailing list