Commit cc3228f6 authored by Brad King's avatar Brad King
Browse files

ENH: Shortened and grouped IOS and STL feature macro names.

parent 43605853
......@@ -47,13 +47,13 @@
# SET(KWSYS_LIBRARY_INSTALL_DIR /lib)
# SET(KWSYS_HEADER_INSTALL_DIR /include)
#
# KWSYS_FORCE_OLD_STREAMS = Force use of old non-ANSI C++ streams even if
# new streams are available. This may be used
# by projects that cannot configure their
# streams library.
# KWSYS_IOS_FORCE_OLD = Force use of old non-ANSI C++ streams even if
# new streams are available. This may be used
# by projects that cannot configure their
# streams library.
# Example:
#
# SET(KWSYS_FORCE_OLD_STREAMS 1)
# SET(KWSYS_IOS_FORCE_OLD 1)
#
# Once configured, kwsys should be used as follows from C or C++ code:
......@@ -114,54 +114,54 @@ ENDIF(CMAKE_ANSI_CFLAGS)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/kwsysPlatformCxxTests.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
KWSYS_PLATFORM_CXX_TEST(KWSYS_HAVE_STL_STD
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAVE_STD
"Checking whether STL classes are in std" DIRECT)
# Select ANSI or old streams.
IF(KWSYS_FORCE_OLD_STREAMS)
SET(KWSYS_HAVE_ANSI_STREAMS 0)
ELSE(KWSYS_FORCE_OLD_STREAMS)
CHECK_INCLUDE_FILE_CXX("iosfwd" KWSYS_HAVE_ANSI_STREAMS)
IF(KWSYS_HAVE_ANSI_STREAMS)
SET(KWSYS_HAVE_ANSI_STREAMS 1)
ELSE(KWSYS_HAVE_ANSI_STREAMS)
SET(KWSYS_HAVE_ANSI_STREAMS 0)
ENDIF(KWSYS_HAVE_ANSI_STREAMS)
ENDIF(KWSYS_FORCE_OLD_STREAMS)
IF(KWSYS_IOS_FORCE_OLD)
SET(KWSYS_IOS_HAVE_ANSI 0)
ELSE(KWSYS_IOS_FORCE_OLD)
CHECK_INCLUDE_FILE_CXX("iosfwd" KWSYS_IOS_HAVE_ANSI)
IF(KWSYS_IOS_HAVE_ANSI)
SET(KWSYS_IOS_HAVE_ANSI 1)
ELSE(KWSYS_IOS_HAVE_ANSI)
SET(KWSYS_IOS_HAVE_ANSI 0)
ENDIF(KWSYS_IOS_HAVE_ANSI)
ENDIF(KWSYS_IOS_FORCE_OLD)
# Select string stream.
IF(KWSYS_HAVE_ANSI_STREAMS)
KWSYS_PLATFORM_CXX_TEST(KWSYS_HAVE_ANSI_STREAMS_STD
IF(KWSYS_IOS_HAVE_ANSI)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAVE_STD
"Checking whether ANSI streams are in std" DIRECT)
CHECK_INCLUDE_FILE_CXX("sstream" KWSYS_HAVE_ANSI_SSTREAM)
IF(KWSYS_HAVE_ANSI_SSTREAM)
SET(KWSYS_HAVE_ANSI_SSTREAM 1)
ELSE(KWSYS_HAVE_ANSI_SSTREAM)
SET(KWSYS_HAVE_ANSI_SSTREAM 0)
ENDIF(KWSYS_HAVE_ANSI_SSTREAM)
ELSE(KWSYS_HAVE_ANSI_STREAMS)
SET(KWSYS_HAVE_ANSI_STREAMS_STD 0)
SET(KWSYS_HAVE_ANSI_SSTREAM 0)
ENDIF(KWSYS_HAVE_ANSI_STREAMS)
IF(KWSYS_HAVE_ANSI_SSTREAM)
SET(KWSYS_HAVE_OLD_STRSTREA_H 0)
SET(KWSYS_HAVE_OLD_STRSTREAM_H 0)
ELSE(KWSYS_HAVE_ANSI_SSTREAM)
CHECK_INCLUDE_FILE_CXX("strstream.h" KWSYS_HAVE_OLD_STRSTREAM_H)
IF(KWSYS_HAVE_OLD_STRSTREAM_H)
SET(KWSYS_HAVE_OLD_STRSTREAM_H 1)
SET(KWSYS_HAVE_OLD_STRSTREA_H 0)
ELSE(KWSYS_HAVE_OLD_STRSTREAM_H)
SET(KWSYS_HAVE_OLD_STRSTREAM_H 0)
CHECK_INCLUDE_FILE_CXX("strstrea.h" KWSYS_HAVE_OLD_STRSTREA_H)
IF(KWSYS_HAVE_O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AVE_STRSTREAM_H)
ENDIF(KWSYS_IOS_HAVE_SSTREAM)
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
SET(KWSYS_NAME_IS_KWSYS 1)
......
......@@ -17,45 +17,38 @@
/* Whether kwsys namespace is "kwsys". */
#define @KWSYS_NAMESPACE@_NAME_IS_KWSYS @KWSYS_NAME_IS_KWSYS@
/* Whether ANSI C++ stream headers are present. */
#define @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS @KWSYS_HAVE_ANSI_STREAMS@
/* Whether ANSI C++ stream headers are to be used. */
#define @KWSYS_NAMESPACE@_IOS_HAVE_ANSI @KWSYS_IOS_HAVE_ANSI@
/* Whether ANSI C++ streams are in std namespace. */
#define @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS_STD @KWSYS_HAVE_ANSI_STREAMS_STD@
#define @KWSYS_NAMESPACE@_IOS_HAVE_STD @KWSYS_IOS_HAVE_STD@
/* Whether ANSI C++ <sstream> header is present and needed. */
#define @KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM @KWSYS_HAVE_ANSI_SSTREAM@
/* Whether ANSI C++ <sstream> header is to be used. */
#define @KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM @KWSYS_IOS_HAVE_SSTREAM@
/* Whether old C++ <strstream.h> header is present and needed. */
#define @KWSYS_NAMESPACE@_HAVE_OLD_STRSTREAM_H @KWSYS_HAVE_OLD_STRSTREAM_H@
/* Whether old C++ <strstream.h> header is to be used. */
#define @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREAM_H @KWSYS_IOS_HAVE_STRSTREAM_H@
/* Whether old C++ <strstrea.h> header is present and needed. */
#define @KWSYS_NAMESPACE@_HAVE_OLD_STRSTREA_H @KWSYS_HAVE_OLD_STRSTREA_H@
/* Whether old C++ <strstrea.h> header is to be used. */
#define @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREA_H @KWSYS_IOS_HAVE_STRSTREA_H@
/* Whether STL is in std namespace. */
#define @KWSYS_NAMESPACE@_HAVE_STL_STD @KWSYS_HAVE_STL_STD@
/* Whether the std namespace is the GCC 2.95 hack. */
#if defined(__GNUC__) && (__GNUC__ < 3)
# define @KWSYS_NAMESPACE@_FAKE_STD_NAMESPACE 1
#else
# define @KWSYS_NAMESPACE@_FAKE_STD_NAMESPACE 0
#endif
#define @KWSYS_NAMESPACE@_STL_HAVE_STD @KWSYS_STL_HAVE_STD@
/* Define the stl namespace macro. */
#if @KWSYS_NAMESPACE@_HAVE_STL_STD
#if @KWSYS_NAMESPACE@_STL_HAVE_STD
# define @KWSYS_NAMESPACE@_stl std
#else
# define @KWSYS_NAMESPACE@_stl
#endif
/* Define the ios namespace macro. */
#if @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS_STD
#if @KWSYS_NAMESPACE@_IOS_HAVE_STD
# define @KWSYS_NAMESPACE@_ios_namespace std
#else
# define @KWSYS_NAMESPACE@_ios_namespace
#endif
#if @KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
#if @KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios_namespace
#else
# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios
......@@ -68,10 +61,13 @@
# define kwsys_stl @KWSYS_NAMESPACE@_stl
# define kwsys_ios @KWSYS_NAMESPACE@_ios
# endif
# define KWSYS_HAVE_STL_STD @KWSYS_NAMESPACE@_HAVE_STL_STD
# define KWSYS_HAVE_ANSI_STREAMS @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS
# define KWSYS_HAVE_ANSI_STREAMS_STD @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS_STD
# define KWSYS_HAVE_ANSI_SSTREAM @KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
# define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define KWSYS_IOS_HAVE_ANSI @KWSYS_NAMESPACE@_IOS_HAVE_ANSI
# define KWSYS_IOS_HAVE_STD @KWSYS_NAMESPACE@_IOS_HAVE_STD
# define KWSYS_IOS_HAVE_SSTREAM @KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
# define KWSYS_IOS_HAVE_STRSTREAM_H @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREAM_H
# define KWSYS_IOS_HAVE_STRSTREA_H @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREA_H
# define KWSYS_STL_HAVE_STD @KWSYS_NAMESPACE@_STL_HAVE_STD
#endif
#endif
#ifdef TEST_KWSYS_HAVE_STL_STD
#ifdef TEST_KWSYS_STL_HAVE_STD
#include <list>
void f(std::list<int>*) {}
int main() { return 0; }
#endif
#ifdef TEST_KWSYS_HAVE_ANSI_STREAMS_STD
#ifdef TEST_KWSYS_IOS_HAVE_STD
#include <iosfwd>
void f(std::ostream*) {}
int main() { return 0; }
......
......@@ -21,13 +21,13 @@
#pragma warning (disable: 4702)
#endif
#if @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS
#if @KWSYS_NAMESPACE@_IOS_HAVE_ANSI
# include <fstream>
#else
# include <fstream.h>
#endif
#if !@KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
#if !@KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
namespace @KWSYS_NAMESPACE@_ios
{
using @KWSYS_NAMESPACE@_ios_namespace::ostream;
......
......@@ -21,7 +21,7 @@
#pragma warning (disable: 4702)
#endif
#if @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS
#if @KWSYS_NAMESPACE@_IOS_HAVE_ANSI
# include <iosfwd>
#else
class fstream;
......@@ -32,7 +32,7 @@ class ofstream;
class ostream;
#endif
#if !@KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
#if !@KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
namespace @KWSYS_NAMESPACE@_ios
{
using @KWSYS_NAMESPACE@_ios_namespace::fstream;
......
......@@ -21,13 +21,13 @@
#pragma warning (disable: 4702)
#endif
#if @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS
#if @KWSYS_NAMESPACE@_IOS_HAVE_ANSI
# include <iostream>
#else
# include <iostream.h>
#endif
#if !@KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
#if !@KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
namespace @KWSYS_NAMESPACE@_ios
{
using @KWSYS_NAMESPACE@_ios_namespace::ostream;
......
......@@ -21,7 +21,7 @@
# define kwsys_stl @KWSYS_NAMESPACE@_stl
#endif
#if @KWSYS_NAMESPACE@_HAVE_ANSI_SSTREAM
#if @KWSYS_NAMESPACE@_IOS_HAVE_SSTREAM
# ifdef _MSC_VER
# pragma warning (push, 1)
# pragma warning (disable: 4702)
......@@ -35,11 +35,11 @@
# pragma warning (push, 1)
# pragma warning (disable: 4702)
# endif
# if @KWSYS_NAMESPACE@_HAVE_ANSI_STREAMS
# if @KWSYS_NAMESPACE@_IOS_HAVE_ANSI
# include <strstream>
# elif @KWSYS_NAMESPACE@_HAVE_OLD_STRSTREAM_H
# elif @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREAM_H
# include <strstream.h>
# elif @KWSYS_NAMESPACE@_HAVE_OLD_STRSTREA_H
# elif @KWSYS_NAMESPACE@_IOS_HAVE_STRSTREA_H
# include <strstrea.h>
# endif
# ifdef _MSC_VER
......
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