Commit 719638e2 authored by Brad King's avatar Brad King

KWSys: Remove dependencies on FundamentalType

The hash_fun.hxx header is configured whether FundamentalType is enabled
or not and so cannot depend on it.  Run the relevant platform tests
whether or not FundamentalType is on and configure the result directly
into hash_fun.  While at it, remove the dependence of SystemInformation
on FundamentalType too since it needs only information that we now
always compute.
parent 48aeb751
......@@ -141,7 +141,6 @@ IF(KWSYS_USE_Process)
SET(KWSYS_USE_System 1)
ENDIF(KWSYS_USE_Process)
IF(KWSYS_USE_SystemInformation)
SET(KWSYS_USE_FundamentalType 1)
SET(KWSYS_USE_Process 1)
ENDIF(KWSYS_USE_SystemInformation)
......@@ -413,6 +412,39 @@ IF(UNIX)
"Checking whether struct stat has st_mtim member" DIRECT)
ENDIF(UNIX)
# Check existence and uniqueness of long long and __int64.
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG
"Checking whether C++ compiler has 'long long'" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS___INT64
"Checking whether C++ compiler has '__int64'" DIRECT)
IF(KWSYS_CXX_HAS___INT64)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64
"Checking whether long and __int64 are the same type" DIRECT)
IF(KWSYS_CXX_HAS_LONG_LONG)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64
"Checking whether long long and __int64 are the same type" DIRECT)
ENDIF()
ENDIF()
# Enable the "long long" type if it is available. It is standard in
# C99 and C++03 but not in earlier standards.
IF(KWSYS_CXX_HAS_LONG_LONG)
SET(KWSYS_USE_LONG_LONG 1)
ELSE()
SET(KWSYS_USE_LONG_LONG 0)
ENDIF()
# Enable the "__int64" type if it is available and unique. It is not
# standard.
SET(KWSYS_USE___INT64 0)
IF(KWSYS_CXX_HAS___INT64)
IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64)
IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64)
SET(KWSYS_USE___INT64 1)
ENDIF()
ENDIF()
ENDIF()
IF(KWSYS_USE_FundamentalType)
# Look for type size helper macros.
KWSYS_PLATFORM_INFO_TEST(C KWSYS_C_TYPE_MACROS
......@@ -463,34 +495,6 @@ IF(KWSYS_USE_FundamentalType)
ENDIF()
ENDFOREACH()
# Check uniqueness of types.
IF(KWSYS_SIZEOF___INT64)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64
"Checking whether long and __int64 are the same type" DIRECT)
IF(KWSYS_SIZEOF_LONG_LONG)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64
"Checking whether long long and __int64 are the same type" DIRECT)
ENDIF(KWSYS_SIZEOF_LONG_LONG)
ENDIF(KWSYS_SIZEOF___INT64)
# Enable the "long long" type if it is available. It is standard in
# C99 and C++03 but not in earlier standards.
IF(KWSYS_SIZEOF_LONG_LONG)
SET(KWSYS_USE_LONG_LONG 1)
ELSE(KWSYS_SIZEOF_LONG_LONG)
SET(KWSYS_USE_LONG_LONG 0)
ENDIF(KWSYS_SIZEOF_LONG_LONG)
# Enable the "__int64" type if it is available and unique. It is not
# standard.
SET(KWSYS_USE___INT64 0)
IF(KWSYS_SIZEOF___INT64)
IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64)
IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64)
SET(KWSYS_USE___INT64 1)
ENDIF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64)
ENDIF(NOT KWSYS_CXX_SAME_LONG_AND___INT64)
ENDIF(KWSYS_SIZEOF___INT64)
IF(KWSYS_USE___INT64)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CAN_CONVERT_UI64_TO_DOUBLE
"Checking whether unsigned __int64 can convert to double" DIRECT)
......@@ -505,8 +509,6 @@ ENDIF(KWSYS_USE_FundamentalType)
IF(KWSYS_USE_IOStream)
# Determine whether iostreams support long long.
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG
"Checking whether C++ compiler has 'long long'" DIRECT)
IF(KWSYS_CXX_HAS_LONG_LONG)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
......@@ -563,6 +565,12 @@ IF(KWSYS_USE_SystemTools)
COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}")
ENDIF()
IF(KWSYS_USE_SystemInformation)
SET_PROPERTY(SOURCE SystemInformation.cxx PROPERTY
COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=${KWSYS_USE_LONG_LONG}
KWSYS_USE___INT64=${KWSYS_USE___INT64})
ENDIF()
#-----------------------------------------------------------------------------
# Choose a directory for the generated headers.
IF(NOT KWSYS_HEADER_ROOT)
......
......@@ -26,7 +26,6 @@
// http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx
#include "kwsysPrivate.h"
#include KWSYS_HEADER(FundamentalType.h)
#include KWSYS_HEADER(stl/string)
#include KWSYS_HEADER(stl/vector)
#include KWSYS_HEADER(ios/iosfwd)
......@@ -38,7 +37,6 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "FundamentalType.h.in"
# include "SystemInformation.hxx.in"
# include "Process.h.in"
# include "Configure.hxx.in"
......
......@@ -38,7 +38,6 @@
#define @KWSYS_NAMESPACE@_hash_fun_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/FundamentalType.h>
#include <@KWSYS_NAMESPACE@/cstddef> // size_t
#include <@KWSYS_NAMESPACE@/stl/string> // string
......@@ -124,7 +123,7 @@ struct hash<unsigned long> {
};
// use long long or __int64
#if @KWSYS_NAMESPACE@_USE_LONG_LONG
#if @KWSYS_USE_LONG_LONG@
@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
struct hash<long long> {
size_t operator()(long long __x) const { return __x; }
......@@ -134,7 +133,7 @@ struct hash<long long> {
struct hash<unsigned long long> {
size_t operator()(unsigned long long __x) const { return __x; }
};
#elif @KWSYS_NAMESPACE@_USE___INT64
#elif @KWSYS_USE___INT64@
@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
struct hash<__int64> {
size_t operator()(__int64 __x) const { return __x; }
......
......@@ -122,6 +122,15 @@ int main()
}
#endif
#ifdef TEST_KWSYS_CXX_HAS___INT64
__int64 f(__int64 n) { return n; }
int main()
{
__int64 n = 0;
return static_cast<int>(f(n));
}
#endif
#ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
template <class T> class A;
template <class T> int f(A<T>&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment