now use unsigned __int64 for time type when on MSVC, that is supported

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: https://svn.code.sf.net/p/freeglut/code/trunk@1116 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2012-03-12 03:32:53 +00:00
parent 83672b987c
commit fe9b63c890
3 changed files with 13 additions and 1 deletions

View File

@ -178,7 +178,16 @@ ENDIF()
# decide on suitable type for internal time keeping, 64-bit if possible # decide on suitable type for internal time keeping, 64-bit if possible
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H) CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
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) 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 # The generated config.h is placed in the project's build directory, just to

View File

@ -16,3 +16,4 @@
#cmakedefine HAVE_STDINT_H #cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_INTTYPES_H #cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_ULONG_LONG #cmakedefine HAVE_ULONG_LONG
#cmakedefine HAVE_U__INT64

View File

@ -163,6 +163,8 @@
#elif defined(HAVE_INTTYPES_H) #elif defined(HAVE_INTTYPES_H)
# include <inttypes.h> # include <inttypes.h>
typedef uint64_t fg_time_t; typedef uint64_t fg_time_t;
#elif defined(HAVE_U__INT64)
typedef unsigned __int64 fg_time_t;
#elif defined(HAVE_ULONG_LONG) #elif defined(HAVE_ULONG_LONG)
typedef unsigned long long fg_time_t; typedef unsigned long long fg_time_t;
#else #else