[Rpm-maint] [rpm-software-management/rpm] rpmio: fix macOS compile error by moving Apple environ include to file scope (PR #4159)
majianhan
notifications at github.com
Fri Mar 20 04:36:38 UTC 2026
On macOS, `rpmio/lposix.cc` fails to compile with Clang because
`#include <crt_externs.h>` is nested inside a function body. The
header contains declarations that must appear at file scope, triggering:
```
error: expected unqualified-id
```
**Fix:** Move the `#ifdef __APPLE__ ... #include <crt_externs.h> ...
#define environ ... #else ... extern char **environ ... #endif` block
from inside `Pgetenv()` to file scope, alongside the other system
includes. The function body now simply uses `environ` directly, which
is defined at file scope for both macOS and non-Apple platforms.
Fixes #4139
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/4159
-- Commit Summary --
* rpmio: fix macOS compile error in lposix.cc by moving include out of function
-- File Changes --
M rpmio/lposix.cc (13)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/4159.patch
https://github.com/rpm-software-management/rpm/pull/4159.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4159
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/4159 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260319/7deeaaa5/attachment.htm>
More information about the Rpm-maint
mailing list