Skip to content

Commit 72dab8f

Browse files
authored
Build for Mac/Linux/Windows as a PR check (#980)
* Build for Mac/Linux/Windows as a PR check * Windows doesn't have setenv() or unsetenv(), created macros to call _putenv() instead.
1 parent 0917c07 commit 72dab8f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/build-fujinet-pc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ on:
2020
type: boolean
2121
default: false
2222

23+
pull_request:
24+
# Do not build release branch
25+
branches:
26+
- "**"
27+
- "!release"
28+
2329
schedule:
2430
- cron: '12 3 * * *'
2531

lib/clock/Clock.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#include "../config/fnConfig.h"
99
#include "utils.h"
1010

11+
#ifdef _WIN32
12+
#define setenv(name, value, overwrite) _putenv_s(name, value)
13+
#define unsetenv(name) _putenv_s(name, "")
14+
#endif /* _WIN32 */
15+
1116
// Helper function to set timezone and restore it after use
1217
class ScopedTimezone {
1318
std::string oldTz;
@@ -126,4 +131,4 @@ std::string Clock::get_current_time_sos(const std::string& posixTimeZone) {
126131
char buffer[30];
127132
std::strftime(buffer, sizeof(buffer), "%Y%m%d0%H%M%S000", &localTime);
128133
return std::string(buffer);
129-
}
134+
}

0 commit comments

Comments
 (0)