Skip to content

Commit

Permalink
main: do not declare environ on Windows
Browse files Browse the repository at this point in the history
When building with `/MD` on Windows, `environ` is a macro expanding to
`__p_environ` which has dll-export storage.  However, the redeclaration
does not annotate the DLL storage causing a mismatch warning
(`-Winconsistent-dllstorage`) which will be treated as an error.  Let
the declaration from the system headers be the declaration required.

Closes #15300.

PiperOrigin-RevId: 448913737
  • Loading branch information
compnerd authored and copybara-github committed May 16, 2022
1 parent d326889 commit 03ad0cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@

using blaze_util::GetLastErrorString;

#if !defined(_WIN32)
extern char **environ;
#endif

namespace blaze {

Expand Down

0 comments on commit 03ad0cd

Please sign in to comment.