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

via flang-commits flang-commits at lists.llvm.org
Fri Jan 12 03:53:27 PST 2024


Author: Dan McGregor
Date: 2024-01-12T11:53:22Z
New Revision: a762cc21556bbd90ae7d9ee13c33213501195f64

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

LOG: [flang] include sys/wait.h for EXECUTE_COMMAND_LINE (#77675)

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.

Added: 
    

Modified: 
    flang/runtime/execute.cpp

Removed: 
    


################################################################################
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
 


        


More information about the flang-commits mailing list