Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / kwsys / IOStream.hxx.in
blob152ff5eaec6e3b316477fcbd34745e62058ff5e5
1 /*=========================================================================
3 Program: KWSys - Kitware System Library
4 Module: $RCSfile: IOStream.hxx.in,v $
6 Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
13 =========================================================================*/
14 #ifndef @KWSYS_NAMESPACE@_IOStream_hxx
15 #define @KWSYS_NAMESPACE@_IOStream_hxx
17 #include <@KWSYS_NAMESPACE@/ios/iosfwd>
19 /* Define these macros temporarily to keep the code readable. */
20 #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
21 # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
22 # define kwsys_ios @KWSYS_NAMESPACE@_ios
23 #endif
25 /* Whether istream supports long long. */
26 #define @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_IOS_HAS_ISTREAM_LONG_LONG@
28 /* Whether ostream supports long long. */
29 #define @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_IOS_HAS_OSTREAM_LONG_LONG@
31 /* Size of type long long and 0 if not available. */
32 #define @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG @KWSYS_SIZEOF_LONG_LONG@
34 /* Determine whether we need to define the streaming operators for
35 long long or __int64. */
36 #if @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG
37 # if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG || \
38 !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
39 # define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1
40 namespace @KWSYS_NAMESPACE@
42 typedef long long IOStreamSLL;
43 typedef unsigned long long IOStreamULL;
45 # endif
46 #elif defined(_MSC_VER) && _MSC_VER < 1300
47 # define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1
48 namespace @KWSYS_NAMESPACE@
50 typedef __int64 IOStreamSLL;
51 typedef unsigned __int64 IOStreamULL;
53 #endif
54 #if !defined(@KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL)
55 # define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 0
56 #endif
58 #if @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL
59 # if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG
61 /* Input stream operator implementation functions. */
62 namespace @KWSYS_NAMESPACE@
64 kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&,
65 IOStreamSLL&);
66 kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&,
67 IOStreamULL&);
70 /* Provide input stream operator for long long. */
71 # if !defined(@KWSYS_NAMESPACE@_IOS_NO_ISTREAM_LONG_LONG) && \
72 !defined(KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED)
73 # define KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED
74 # define @KWSYS_NAMESPACE@_IOS_ISTREAM_LONG_LONG_DEFINED
75 inline kwsys_ios::istream&
76 operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value)
78 return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
80 # endif
82 /* Provide input stream operator for unsigned long long. */
83 # if !defined(@KWSYS_NAMESPACE@_IOS_NO_ISTREAM_UNSIGNED_LONG_LONG) && \
84 !defined(KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED)
85 # define KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
86 # define @KWSYS_NAMESPACE@_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
87 inline kwsys_ios::istream&
88 operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value)
90 return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
92 # endif
93 # endif /* !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG */
95 # if !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
97 /* Output stream operator implementation functions. */
98 namespace @KWSYS_NAMESPACE@
100 kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&,
101 IOStreamSLL);
102 kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&,
103 IOStreamULL);
106 /* Provide output stream operator for long long. */
107 # if !defined(@KWSYS_NAMESPACE@_IOS_NO_OSTREAM_LONG_LONG) && \
108 !defined(KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED)
109 # define KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED
110 # define @KWSYS_NAMESPACE@_IOS_OSTREAM_LONG_LONG_DEFINED
111 inline kwsys_ios::ostream&
112 operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value)
114 return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
116 # endif
118 /* Provide output stream operator for unsigned long long. */
119 # if !defined(@KWSYS_NAMESPACE@_IOS_NO_OSTREAM_UNSIGNED_LONG_LONG) && \
120 !defined(KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED)
121 # define KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
122 # define @KWSYS_NAMESPACE@_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
123 inline kwsys_ios::ostream&
124 operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
126 return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
128 # endif
129 # endif /* !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG */
130 #endif /* @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL */
132 /* Undefine temporary macros. */
133 #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
134 # undef kwsysEXPORT
135 # undef kwsys_ios
136 #endif
138 /* If building a C++ file in kwsys itself, give the source file
139 access to the macros without a configured namespace. */
140 #if defined(KWSYS_NAMESPACE)
141 # define KWSYS_IOS_SIZEOF_LONG_LONG @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG
142 # define KWSYS_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG
143 # define KWSYS_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
144 # define KWSYS_IOS_NEED_OPERATORS_LL @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL
145 #endif
147 #endif