eclipse / tinydtls

Eclipse tinydtls
https://projects.eclipse.org/projects/iot.tinydtls
Other
105 stars 58 forks source link

windows: address Visual Studio warnings #169

Open JKRhb opened 2 years ago

JKRhb commented 2 years ago

This PR is a small follow-up to #126, addressing two warnings raised by Visual Studio when compiling for Windows.

In order to address the warnings, this PR introduces a platform-specific print_timestamp function, using localtime_s instead of localtime (which led to the emission of warnings for being insecure). Furthermore, the definition of _CRT_RAND_S is moved to tinydtls.h as it initializes the global state of the rand_s function and defining it in dtls_prng_win.c was apparently too late in the compilation process.