[flang-commits] [flang] [flang] include sys/wait.h for EXECUTE_COMMAND_LINE (PR #77675)

via flang-commits flang-commits at lists.llvm.org
Wed Jan 10 11:49:17 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-runtime

Author: Dan McGregor (dankm)

<details>
<summary>Changes</summary>

Linux defines WEXITSTATUS in stdlib.h, but at least FreeBSD and NetBSD only define it in sys/wait.h. Include this header unconditionally, since it is required on the BSDs and should be harmless on other platforms.

Fixes FreeBSD build after #<!-- -->74077.

---
Full diff: https://github.com/llvm/llvm-project/pull/77675.diff


1 Files Affected:

- (modified) flang/runtime/execute.cpp (+1) 


``````````diff
diff --git a/flang/runtime/execute.cpp b/flang/runtime/execute.cpp
index 48773ae8114b0b..246495dd4954ad 100644
--- a/flang/runtime/execute.cpp
+++ b/flang/runtime/execute.cpp
@@ -21,6 +21,7 @@
 #include <windows.h>
 #else
 #include <signal.h>
+#include <sys/wait.h>
 #include <unistd.h>
 #endif
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/77675


More information about the flang-commits mailing list