]> granicus.if.org Git - check/commitdiff
cmake: add check for struct timespec for windows
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 25 Dec 2013 03:04:36 +0000 (03:04 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 25 Dec 2013 03:04:36 +0000 (03:04 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@952 64e312b2-a51f-0410-8e61-82d0ca0eb02a

CMakeLists.txt

index fca722fb84ee92ddcafba1cfdad171746e9597f6..8d12291ba52a653eb3a362fd7a2ce6613cee6504 100644 (file)
@@ -225,6 +225,12 @@ if(NOT HAVE_SYS_TIME_H)
     if(MSVC)
         check_struct_member("struct timeval" tv_sec "Winsock2.h" HAVE_STRUCT_TIMEVAL_TV_SEC)
         check_struct_member("struct timeval" tv_usec "Winsock2.h" HAVE_STRUCT_TIMEVAL_TV_USEC)
+        check_struct_member("struct timespec" tv_usec "Winsock2.h" HAVE_STRUCT_TIMESPEC_TV_SEC)
+
+        if(NOT HAVE_STRUCT_TIMESPEC_TV_SEC)
+            add_definitions(-DSTRUCT_TIMESPEC_DEFINITION_MISSING=1)
+            set(STRUCT_TIMESPEC_DEFINITION_MISSING 1)
+        endif(NOT HAVE_STRUCT_TIMESPEC_TV_SEC)
     endif(MSVC)
 endif(NOT HAVE_SYS_TIME_H)