now use unsigned __int64 for time type when on MSVC, that is supported
authorDiederick Niehorster <dcnieho@gmail.com>
Mon, 12 Mar 2012 03:32:53 +0000 (03:32 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Mon, 12 Mar 2012 03:32:53 +0000 (03:32 +0000)
down to at least MSVC6 (thanks Sisyphus!)
Also, type present checks are not done if stdint or inttypes headers are
found, no need for them then.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1116 7f0cb862-5218-0410-a997-914c9d46530a

CMakeLists.txt
config.h.in
src/fg_internal.h

index 98559b4..9fa75b4 100644 (file)
@@ -178,7 +178,16 @@ ENDIF()
 # decide on suitable type for internal time keeping, 64-bit if possible
 CHECK_INCLUDE_FILES(stdint.h    HAVE_STDINT_H)
 CHECK_INCLUDE_FILES(inttypes.h  HAVE_INTTYPES_H)
-CHECK_TYPE_SIZE("unsigned long long" ULONG_LONG BUILTIN_TYPES_ONLY)
+IF (NOT (HAVE_STDINT_H OR HAVE_INTTYPES_H))
+    IF (MSVC)
+        # Some old Microsoft VC don't support unsigned long long, but all we
+        # care about support unsigned __int64, so test for presence of that
+        # type
+        CHECK_TYPE_SIZE("unsigned __int64" U__INT64 BUILTIN_TYPES_ONLY)
+    ELSEIF()
+        CHECK_TYPE_SIZE("unsigned long long" ULONG_LONG BUILTIN_TYPES_ONLY)
+    ENDIF()
+ENDIF()
 
 
 # The generated config.h is placed in the project's build directory, just to
index f38897a..60cd956 100644 (file)
@@ -16,3 +16,4 @@
 #cmakedefine HAVE_STDINT_H
 #cmakedefine HAVE_INTTYPES_H
 #cmakedefine HAVE_ULONG_LONG
+#cmakedefine HAVE_U__INT64
index 34fdc8e..6fa691f 100644 (file)
 #elif defined(HAVE_INTTYPES_H)
 #   include <inttypes.h>
     typedef uint64_t fg_time_t;
+#elif defined(HAVE_U__INT64)
+    typedef unsigned __int64 fg_time_t;
 #elif defined(HAVE_ULONG_LONG)
     typedef unsigned long long fg_time_t;
 #else