Skip to content

Commit

Permalink
Explicitly declare the environ variable
Browse files Browse the repository at this point in the history
While glibc includes a declaration of `environ` within `unistd.h`, this
is not always the case for other libc instances; POSIX states that
`environ` "must be declared by the user if it is to be used directly"¹.

This fixes a build failure on FreeBSD reported at
#305 (comment)

 ¹ https://pubs.opengroup.org/onlinepubs/9699919799/
  • Loading branch information
fbriere committed Oct 19, 2022
1 parent ef18b59 commit 6c42096
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/call_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "userintf.h"
#include "util.h"

extern char **environ;

extern t_phone *phone;

// Maximum length of the reason value
Expand Down

0 comments on commit 6c42096

Please sign in to comment.