diff options
| author | cremno <[email protected]> | 2015-03-22 22:52:12 +0100 |
|---|---|---|
| committer | cremno <[email protected]> | 2015-03-22 22:52:12 +0100 |
| commit | c47cc0c3bbeece6f08870255b9b21db326678ba3 (patch) | |
| tree | 743170b24b03a92a5462cb81334efd5083f59bb8 /mrbgems/mruby-bin-debugger/tools | |
| parent | 17b77455935472c10803f76635f85bba433289d2 (diff) | |
| download | mruby-c47cc0c3bbeece6f08870255b9b21db326678ba3.tar.gz mruby-c47cc0c3bbeece6f08870255b9b21db326678ba3.zip | |
call C11's timespec_get()
gettimeofday() is an obsolescent POSIX function which may be removed in
a future version. POSIX recommends using clock_gettime() (also POSIX)
instead, but it isn't available on OS X or Windows (at least with MSVC
and older MinGW versions).
Whereas timespec_get() is part of ISO C11 and mruby uses some small
other C11 features too. It isn't universally available yet either, but
it might be in the future. And Visual C++ 2015 implements it! Since
mruby strives for ISO C and not POSIX compatibility, I think it's a
reasonable choice.
TIME_UTC is used instead of __STDC_VERSION__, because if TIME_UTC is
defined, then most likely timespec_get() is too. This isn't true in case
of __STDC_VERSION__ (see MSVC).
Diffstat (limited to 'mrbgems/mruby-bin-debugger/tools')
0 files changed, 0 insertions, 0 deletions
