Skip to content

Commit cf5aa55

Browse files
[flang] Don't redefine pid_t on MinGW-w64. (#130288)
1 parent a576304 commit cf5aa55

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

flang-rt/lib/runtime/command.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
#define getcwd _getcwd
2222
#define PATH_MAX MAX_PATH
2323

24+
#ifdef _MSC_VER
2425
// On Windows GetCurrentProcessId returns a DWORD aka uint32_t
2526
#include <processthreadsapi.h>
2627
inline pid_t getpid() { return GetCurrentProcessId(); }
28+
#endif
2729
#else
2830
#include <unistd.h> //getpid()
2931

flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <cstdint>
3131
#include <functional>
3232

33-
#ifdef _WIN32
33+
#ifdef _MSC_VER
3434
// On Windows* OS GetCurrentProcessId returns DWORD aka uint32_t
3535
typedef std::uint32_t pid_t;
3636
#endif

flang/include/flang/Runtime/command.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "flang/Runtime/entry-names.h"
1313
#include <cstdint>
1414

15-
#ifdef _WIN32
15+
#ifdef _MSC_VER
1616
// On Windows* OS GetCurrentProcessId returns DWORD aka uint32_t
1717
typedef std::uint32_t pid_t;
1818
#else

0 commit comments

Comments
 (0)