CMake/IOStream.hxx.in

137 lines
4.8 KiB
C++
Raw Normal View History

/*============================================================================
KWSys - Kitware System Library
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef @KWSYS_NAMESPACE@_IOStream_hxx
#define @KWSYS_NAMESPACE@_IOStream_hxx
#include <iosfwd>
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
/* Whether istream supports long long. */
#define @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_IOS_HAS_ISTREAM_LONG_LONG@
/* Whether ostream supports long long. */
#define @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_IOS_HAS_OSTREAM_LONG_LONG@
/* Determine whether we need to define the streaming operators for
long long or __int64. */
KWSys 2013-01-07 (fc60c8b8) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ fc60c8b8 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 8ce09af5..fc60c8b8 Brad King (3): cb5f835f SystemTools: Fix MakeDirectory with colon in path 1643507a IOStream: Fix check for compiler 'long long' support 34177aec SystemTools: Fix MakeDirectory after recent cleanup Rolf Eike Beer (24): 4da9894d SystemInformation: Clean up QuerySolarisInfo() 01392358 SystemInformation: don't attribute i386 Solaris systems to Sun 3db65ac1 SystemInformation: wrap the call to CPUID in a function 61bd9b42 SystemInformation: use the __cpuid compiler intrinsic if present 5932e7c0 SystemInformation: query memory size on Cygwin using sysconf() ea5612ed SystemInformation: count memory with _SC_PAGESIZE and _SC_PHYS_PAGES 3aca6642 SystemInformation: query memory size, CPU count, and CPU speed on BSD 3572c54d SystemInformation: count CPUs on HP-UX e6771b34 SystemInformation: determine CPU type on HP-UX 640210e5 SystemInformation: use /proc/cpuinfo only when present 5bdcfd10 SystemInformation: query total memory on AIX de69d547 SystemInformation: use intrinsic for RDTSC if supported 9808d4e7 SystemInformation: get CPU speed on Windows when RDTSC fails f4c625b5 tests: avoid truncation of testSystemInformation output in CDash 03d6fbe5 SystemInformation: get x86 CPU features from /proc/cpuinfo f8e917c1 SystemInformation: remove the #define CPUID_INSTRUCTION 59c4b5c5 SystemInformation: split Windows code out of QueryMemory() 200ee91f SystemInformation: split HP-UX code out of QueryMemory() 88217703 SystemInformation: split Linux code out of QueryMemory() 9e317872 SystemInformation: split AIX code out of QueryMemory() 349cee5b SystemInformation: remove useless zeroing from QueryMemory() 7271926e SystemInformation: split Cygwin code out of QueryMemory() 6da78ad1 SystemInformation: make QueryMemory() return bool 182179e9 Haiku no longer defines __BEOS__ Stephen Kelly (1): 247b8a3c SystemTools: Rename MakeCnidentifier() to MakeCidentifier() Change-Id: Ib95b5bddab7ecc0a4025ab29792426acf57e5623
2013-01-07 19:20:26 +04:00
#if @KWSYS_USE_LONG_LONG@
# if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG || \
!@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
# define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1
namespace @KWSYS_NAMESPACE@
{
typedef long long IOStreamSLL;
typedef unsigned long long IOStreamULL;
}
# endif
#elif defined(_MSC_VER) && _MSC_VER < 1300
# define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1
namespace @KWSYS_NAMESPACE@
{
typedef __int64 IOStreamSLL;
typedef unsigned __int64 IOStreamULL;
}
#endif
#if !defined(@KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL)
# define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 0
#endif
#if @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL
# if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG
/* Input stream operator implementation functions. */
namespace @KWSYS_NAMESPACE@
{
kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamSLL&);
kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamULL&);
}
/* Provide input stream operator for long long. */
# if !defined(@KWSYS_NAMESPACE@_IOS_NO_ISTREAM_LONG_LONG) && \
!defined(KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED)
# define KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_ISTREAM_LONG_LONG_DEFINED
inline std::istream&
operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value)
{
return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
}
# endif
/* Provide input stream operator for unsigned long long. */
# if !defined(@KWSYS_NAMESPACE@_IOS_NO_ISTREAM_UNSIGNED_LONG_LONG) && \
!defined(KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED)
# define KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
inline std::istream&
operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value)
{
return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
}
# endif
# endif /* !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG */
# if !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
/* Output stream operator implementation functions. */
namespace @KWSYS_NAMESPACE@
{
kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamSLL);
kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamULL);
}
/* Provide output stream operator for long long. */
# if !defined(@KWSYS_NAMESPACE@_IOS_NO_OSTREAM_LONG_LONG) && \
!defined(KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED)
# define KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_OSTREAM_LONG_LONG_DEFINED
inline std::ostream&
operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value)
{
return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
}
# endif
/* Provide output stream operator for unsigned long long. */
# if !defined(@KWSYS_NAMESPACE@_IOS_NO_OSTREAM_UNSIGNED_LONG_LONG) && \
!defined(KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED)
# define KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
inline std::ostream&
operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
{
return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
}
# endif
# endif /* !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG */
#endif /* @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL */
/* Undefine temporary macros. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsysEXPORT
#endif
/* If building a C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
# define KWSYS_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG
# define KWSYS_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
# define KWSYS_IOS_NEED_OPERATORS_LL @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL
#endif
#endif