wgtmac commented on code in PR #1856:
URL: https://github.com/apache/orc/pull/1856#discussion_r1534009189
##########
c++/test/TestTimezone.cc:
##########
@@ -403,20 +410,37 @@ namespace orc {
EXPECT_EQ(1699164000 + 8 * 3600, la->convertFromUTC(1699164000));
}
-#ifndef _MSC_VER
+ bool setEnv(const char* name, const char* value) {
+#ifdef _MSC_VER
+ return SetEnvironmentVariableA(name, value);
+#else
+ return setenv(name, value, 1) == 0;
+#endif
+ }
+
+ bool delEnv(const char* name) {
+#ifdef _MSC_VER
+ return SetEnvironmentVariableA(name, nullptr);
+#else
+ return unsetenv(name) == 0;
+#endif
+ }
Review Comment:
```suggestion
bool setEnv(const char* name, const char* value) {
#ifdef _MSC_VER
return _putenv_s(name, value) == 0;
#else
return setenv(name, value, 1) == 0;
#endif
}
bool delEnv(const char* name) {
#ifdef _MSC_VER
return _putenv_s(name, "") == 0;
#else
return unsetenv(name) == 0;
#endif
}
```
##########
c++/test/TestTimezone.cc:
##########
@@ -21,6 +21,13 @@
#include "wrap/gmock.h"
#include "wrap/gtest-wrapper.h"
+#ifdef _MSC_VER
+// clang-format off
+#include "windows.h"
+#include "processenv.h"
+// clang-format on
+#endif
+
Review Comment:
```suggestion
#include <cstdlib>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]