Skip to content

Commit c0fac1b

Browse files
authored
Do not use get_clock on windows where it is not supported. (#55)
Signed-off-by: John Plevyak <[email protected]>
1 parent 073b92a commit c0fac1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/proxy-wasm/context.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,17 @@ class ContextBase : public RootInterface,
231231
}
232232
uint32_t getLogLevel() override { return static_cast<uint32_t>(LogLevel::info); }
233233
uint64_t getCurrentTimeNanoseconds() override {
234+
#if !defined(_MSC_VER)
234235
struct timespec tpe;
235236
clock_gettime(CLOCK_REALTIME, &tpe);
236237
uint64_t t = tpe.tv_sec;
237238
t *= 1000000000;
238239
t += tpe.tv_nsec;
239240
return t;
241+
#else
242+
unimplemented();
243+
return 0;
244+
#endif
240245
}
241246
std::string_view getConfiguration() override {
242247
unimplemented();

0 commit comments

Comments
 (0)