netcode-io 0.0.1 → 0.0.2
raw patch · 3 files changed
+14/−5 lines, 3 files
Files
- README.md +2/−2
- netcode-io.cabal +4/−1
- netcode.io/netcode.c +8/−2
README.md view
@@ -1,4 +1,4 @@-# netcode-io +# netcode-io [](https://travis-ci.org/Mokosha/netcode-io) Haskell bindings to the [netcode.io](https://github.com/networkprotocol/netcode.io) library @@ -50,4 +50,4 @@ IANAL, but these bindings use [the same license](https://github.com/networkprotocol/netcode.io/blob/master/LICENCE) -that the original library uses, so you must comply with both.+that the original library uses, so you must comply with both.
netcode-io.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: netcode-io -version: 0.0.1 +version: 0.0.2 synopsis: Bindings to the low-level netcode.io library. description: Bindings to the low-level netcode.io library, which come in two flavors: c-level bindings and a high-level @@ -40,6 +40,9 @@ -- possible. That way we don't need to go around copying .dll files. ld-options: -static extra-libraries: ws2_32 + + if os(linux) + cc-options: -D_POSIX_C_SOURCE=199309L exposed-modules: Bindings.Netcode.IO , Netcode.IO
netcode.io/netcode.c view
@@ -5179,7 +5179,10 @@ void netcode_sleep( double time ) { - usleep( (int) ( time * 1000000 ) ); + struct timespec ts; + ts.tv_sec = (time_t) time; + ts.tv_nsec = (long) ((time - (double) ( ts.tv_sec )) * 1000000000.0); + nanosleep( &ts, NULL ); } static uint64_t start = 0; @@ -5205,7 +5208,10 @@ void netcode_sleep( double time ) { - usleep( (int) ( time * 1000000 ) ); + struct timespec ts; + ts.tv_sec = (time_t) time; + ts.tv_nsec = (long) ((time - (double) ( ts.tv_sec )) * 1000000000.0); + nanosleep( &ts, NULL ); } double netcode_time()