summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/CMakeLists.txt8
-rw-r--r--Source/kwsys/Configure.hxx.in4
-rw-r--r--Source/kwsys/hash_fun.hxx.in2
-rw-r--r--Source/kwsys/hashtable.hxx.in1
-rw-r--r--Source/kwsys/kwsysPlatformCxxTests.cxx6
-rw-r--r--Source/kwsys/kwsys_cstddef.hxx.in37
6 files changed, 58 insertions, 0 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index f77d3a0..a1e12bb 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -178,6 +178,9 @@ ELSE(KWSYS_IOS_USE_SSTREAM)
ENDIF(KWSYS_IOS_USE_STRSTREAM_H)
ENDIF(KWSYS_IOS_USE_SSTREAM)
+KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_CSTDDEF
+ "Checking whether header cstddef is available" DIRECT)
+
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD})
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_NEQ_CHAR
@@ -294,6 +297,11 @@ FOREACH(header algorithm deque iterator list map numeric queue set stack string
ENDIF(KWSYS_HEADER_INSTALL_DIR)
ENDFOREACH(header)
+# Provide cstddef header.
+CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_cstddef.hxx.in
+ ${KWSYS_HEADER_DIR}/cstddef
+ @ONLY IMMEDIATE)
+
#-----------------------------------------------------------------------------
# Create streams header wrappers to give standard names by which they
# may be included.
diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in
index 5b9268c..b599388 100644
--- a/Source/kwsys/Configure.hxx.in
+++ b/Source/kwsys/Configure.hxx.in
@@ -63,6 +63,9 @@
# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios
#endif
+/* Whether the cstddef header is available. */
+#define @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF @KWSYS_CXX_HAS_CSTDDEF@
+
/* Whether the compiler supports null template arguments. */
#define @KWSYS_NAMESPACE@_CXX_HAS_NULL_TEMPLATE_ARGS @KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@
@@ -133,6 +136,7 @@
# define KWSYS_IOS_USE_STRSTREAM_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H
# define KWSYS_IOS_USE_STRSTREA_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H
# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM
+# define KWSYS_CXX_HAS_CSTDDEF @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF
# define KWSYS_STL_STRING_HAVE_OSTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM
# define KWSYS_STL_STRING_HAVE_ISTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM
# define KWSYS_STL_STRING_HAVE_NEQ_CHAR @KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR
diff --git a/Source/kwsys/hash_fun.hxx.in b/Source/kwsys/hash_fun.hxx.in
index f40750e..59f445c 100644
--- a/Source/kwsys/hash_fun.hxx.in
+++ b/Source/kwsys/hash_fun.hxx.in
@@ -41,6 +41,8 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
+#include <@KWSYS_NAMESPACE@/cstddef> // size_t
+
namespace @KWSYS_NAMESPACE@
{
diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in
index 061862a..af0ec5f 100644
--- a/Source/kwsys/hashtable.hxx.in
+++ b/Source/kwsys/hashtable.hxx.in
@@ -41,6 +41,7 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
+#include <@KWSYS_NAMESPACE@/cstddef> // size_t
#include <@KWSYS_NAMESPACE@/stl/algorithm> // lower_bound
#include <@KWSYS_NAMESPACE@/stl/functional> // unary_function
#include <@KWSYS_NAMESPACE@/stl/iterator> // iterator_traits
diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx
index a8b3d6f..44c0432 100644
--- a/Source/kwsys/kwsysPlatformCxxTests.cxx
+++ b/Source/kwsys/kwsysPlatformCxxTests.cxx
@@ -59,6 +59,12 @@ bool f(const kwsys_stl::string& s) { return s != ""; }
int main() { return 0; }
#endif
+#ifdef TEST_KWSYS_CXX_HAS_CSTDDEF
+#include <cstddef>
+void f(size_t) {}
+int main() { return 0; }
+#endif
+
#ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
template <class T> class A;
template <class T> int f(A<T>&);
diff --git a/Source/kwsys/kwsys_cstddef.hxx.in b/Source/kwsys/kwsys_cstddef.hxx.in
new file mode 100644
index 0000000..3c951ec
--- /dev/null
+++ b/Source/kwsys/kwsys_cstddef.hxx.in
@@ -0,0 +1,37 @@
+/*=========================================================================
+
+ Program: KWSys - Kitware System Library
+ Module: $RCSfile$
+
+ Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#ifndef @KWSYS_NAMESPACE@_cstddef
+#define @KWSYS_NAMESPACE@_cstddef
+
+#include <@KWSYS_NAMESPACE@/Configure.hxx>
+
+/* Avoid warnings in MSVC standard headers. */
+#ifdef _MSC_VER
+# pragma warning (push, 1)
+# pragma warning (disable: 4702)
+# pragma warning (disable: 4786)
+#endif
+
+/* Include the real header. */
+#if @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF
+# include <cstddef>
+#else
+# include <stddef.h>
+#endif
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+#endif