[flang-commits] [flang] 3db365d - [flang-rt] Fix defining `pid_t` on GPU builds (#178470)
via flang-commits
flang-commits at lists.llvm.org
Wed Jan 28 09:37:37 PST 2026
Author: Joseph Huber
Date: 2026-01-28T11:37:33-06:00
New Revision: 3db365d06eb72d3adf268405e9d6d7d419d5bf45
URL: https://github.com/llvm/llvm-project/commit/3db365d06eb72d3adf268405e9d6d7d419d5bf45
DIFF: https://github.com/llvm/llvm-project/commit/3db365d06eb72d3adf268405e9d6d7d419d5bf45.diff
LOG: [flang-rt] Fix defining `pid_t` on GPU builds (#178470)
Summary:
We support building flang-rt on GPU targets. These do not have POSIX
types so we should not include this if it's not present.
Added:
Modified:
flang/include/flang/Runtime/extensions.h
Removed:
################################################################################
diff --git a/flang/include/flang/Runtime/extensions.h b/flang/include/flang/Runtime/extensions.h
index 40ce77112d183..7746116c7f1fc 100644
--- a/flang/include/flang/Runtime/extensions.h
+++ b/flang/include/flang/Runtime/extensions.h
@@ -18,8 +18,8 @@
#define FORTRAN_PROCEDURE_NAME(name) name##_
-#ifdef _WIN32
-// UID and GID don't exist on Windows, these exist to avoid errors.
+#if defined(_WIN32) || !__has_include("sys/types.h")
+// UID and GID don't exist on all targets, these exist to avoid errors.
typedef std::uint32_t uid_t;
typedef std::uint32_t gid_t;
#else
More information about the flang-commits
mailing list