Skip to content

Commit

Permalink
core: Unbreak build on FreeBSD (#8762)
Browse files Browse the repository at this point in the history
* CrashReporter: restore explicit environ(7) after 8bbeee1

BSD systems don't declare environ(7) in any header like POSIX suggests.

src/signal-safe.cpp:12:23: error: use of undeclared identifier 'environ'
   12 |     for (char** var = environ; *var != nullptr; var++) {
      |                       ^

* fix

---------

Co-authored-by: Vaxry <[email protected]>
  • Loading branch information
jbeich and vaxerski authored Dec 18, 2024
1 parent 0fec38f commit df06cb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/signal-safe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include <unistd.h>
#include <cstring>

// NOLINTNEXTLINE
extern "C" char** environ;

//
char const* sigGetenv(char const* name) {
const size_t len = strlen(name);
for (char** var = environ; *var != nullptr; var++) {
Expand Down

0 comments on commit df06cb4

Please sign in to comment.