Avoid calls to gettimeofday()
Add a new function to get the current time in microseconds, since gettimeofday() does not exist on Windows.
Keep the current implementation for the test applications.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6e0d69..9fef51c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,18 +275,12 @@
list(APPEND HDR_PUBLIC
${WIN32_HELPERS_PATH}/websock-w32.h
- ${WIN32_HELPERS_PATH}/gettimeofday.h
)
- if (MINGW)
- list(APPEND SOURCES
- ${WIN32_HELPERS_PATH}/gettimeofday.c
- )
- else(MINGW)
+ if (NOT MINGW)
list(APPEND SOURCES
${WIN32_HELPERS_PATH}/websock-w32.c
- ${WIN32_HELPERS_PATH}/gettimeofday.c
)
- endif(MINGW)
+ endif()
include_directories(${WIN32_HELPERS_PATH})
else(WIN32)
# Unix.