Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use _putenv_s() on Windows in fuzztest_helpers #2014

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Feb 15, 2024

See b/308013905

@y-guyon y-guyon merged commit 57e32e2 into AOMediaCodec:main Feb 15, 2024
20 checks passed
@y-guyon y-guyon deleted the setenv_windows branch February 15, 2024 14:59
@@ -199,7 +199,13 @@ class Environment : public ::testing::Environment {
public:
Environment(const char* name, const char* value)
: name_(name), value_(value) {}
void SetUp() override { setenv(name_, value_, 1); }
void SetUp() override {
#ifdef WIN32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change WIN32 to _WIN32 . The compiler predefined macro is named _WIN32 .

#ifdef WIN32
_putenv_s(name_, value_); // Defined in stdlib.h.
#else
setenv(name_, value_, /*__replace=*/1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third parameter is documented as overwrite in the posix docs.

@wantehchang
Copy link
Collaborator

I addressed both review comments in #2016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants