Skip to content

Commit 8b6b882

Browse files
authored
[flang] allow _POSIX_SOURCE to be defined without a value (#78179)
The `_POSIX_SOURCE` macro is defined without a value on AIX. Change the check to `defined(_POSIX_SOURCE)`.
1 parent ab33c0b commit 8b6b882

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flang/runtime/extensions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inline void CtimeBuffer(char *buffer, size_t bufsize, const time_t cur_time,
2424
RUNTIME_CHECK(terminator, error == 0);
2525
}
2626
#elif _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || \
27-
_POSIX_SOURCE
27+
defined(_POSIX_SOURCE)
2828
inline void CtimeBuffer(char *buffer, size_t bufsize, const time_t cur_time,
2929
Fortran::runtime::Terminator terminator) {
3030
const char *res{ctime_r(&cur_time, buffer)};

flang/unittests/Runtime/CommandTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class NoArgv : public CommandFixture {
233233
};
234234

235235
#if _WIN32 || _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || \
236-
_SVID_SOURCE || _POSIX_SOURCE
236+
_SVID_SOURCE || defined(_POSIX_SOURCE)
237237
TEST_F(NoArgv, FdateGetDate) {
238238
char input[]{"24LengthCharIsJustRight"};
239239
const std::size_t charLen = sizeof(input);

0 commit comments

Comments
 (0)