summaryrefslogtreecommitdiff
path: root/src/common/cxxstdio.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
commitf906959a09d58c85d87b445fd1791d91bf278bfa (patch)
treeb65282b2c731d4eb2157ae719828cddf6b086943 /src/common/cxxstdio.hpp
parent1fb7ce5a604db78c4d02f719053827269705ce13 (diff)
downloadtmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.gz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.bz2
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.xz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.zip
Use new IO classes
Diffstat (limited to 'src/common/cxxstdio.hpp')
-rw-r--r--src/common/cxxstdio.hpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/common/cxxstdio.hpp b/src/common/cxxstdio.hpp
index 89cc5de..1ae1be3 100644
--- a/src/common/cxxstdio.hpp
+++ b/src/common/cxxstdio.hpp
@@ -24,6 +24,8 @@
#include <cstdarg>
#include <cstdio>
+#include "../io/fwd.hpp"
+
#include "const_array.hpp"
#include "utils2.hpp"
@@ -211,28 +213,28 @@ namespace cxxstdio
};
#define XPRINTF(out, fmt, ...) \
- ([&]() -> int \
+ (/*[&]() -> int*/ \
{ \
struct format_impl \
{ \
constexpr static \
const char *print_format() { return fmt; } \
}; \
- return cxxstdio::PrintFormatter<format_impl>::print(out, ## __VA_ARGS__); \
- }())
+ /*return*/ cxxstdio::PrintFormatter<format_impl>::print(out, ## __VA_ARGS__); \
+ }/*()*/)
#define XSCANF(out, fmt, ...) \
- ([&]() -> int \
+ (/*[&]() -> int*/ \
{ \
struct format_impl \
{ \
constexpr static \
const char *scan_format() { return fmt; } \
}; \
- return cxxstdio::ScanFormatter<format_impl>::scan(out, ## __VA_ARGS__); \
- }())
+ /*return*/ cxxstdio::ScanFormatter<format_impl>::scan(out, ## __VA_ARGS__); \
+ }/*()*/)
-#define FPRINTF(file, fmt, ...) XPRINTF(no_cast<FILE *>(file), fmt, ## __VA_ARGS__)
+#define FPRINTF(file, fmt, ...) XPRINTF(/*no_cast<FILE *>*/(file), fmt, ## __VA_ARGS__)
#define FSCANF(file, fmt, ...) XSCANF(no_cast<FILE *>(file), fmt, ## __VA_ARGS__)
#define PRINTF(fmt, ...) FPRINTF(stdout, fmt, ## __VA_ARGS__)
#define SPRINTF(str, fmt, ...) XPRINTF(base_cast<FString&>(str), fmt, ## __VA_ARGS__)
@@ -241,20 +243,20 @@ namespace cxxstdio
#define SSCANF(str, fmt, ...) XSCANF(/*ZString or compatible*/str, fmt, ## __VA_ARGS__)
#define STRPRINTF(fmt, ...) \
- ([&]() -> FString \
+ (/*[&]() -> FString*/ \
{ \
FString _out_impl; \
SPRINTF(_out_impl, fmt, ## __VA_ARGS__);\
- return _out_impl; \
- }())
+ /*return*/ _out_impl; \
+ }/*()*/)
#define STRNPRINTF(n, fmt, ...) \
- ([&]() -> VString<n - 1> \
+ (/*[&]() -> VString<n - 1>*/ \
{ \
VString<n - 1> _out_impl; \
SNPRINTF(_out_impl, n, fmt, ## __VA_ARGS__);\
- return _out_impl; \
- }())
+ /*return*/ _out_impl; \
+ }/*()*/)
} // namespace cxxstdio