From f906959a09d58c85d87b445fd1791d91bf278bfa Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 15 Nov 2013 17:51:29 -0800 Subject: Use new IO classes --- src/common/cxxstdio.hpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/common/cxxstdio.hpp') 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 #include +#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::print(out, ## __VA_ARGS__); \ - }()) + /*return*/ cxxstdio::PrintFormatter::print(out, ## __VA_ARGS__); \ + }/*()*/) #define XSCANF(out, fmt, ...) \ - ([&]() -> int \ + (/*[&]() -> int*/ \ { \ struct format_impl \ { \ constexpr static \ const char *scan_format() { return fmt; } \ }; \ - return cxxstdio::ScanFormatter::scan(out, ## __VA_ARGS__); \ - }()) + /*return*/ cxxstdio::ScanFormatter::scan(out, ## __VA_ARGS__); \ + }/*()*/) -#define FPRINTF(file, fmt, ...) XPRINTF(no_cast(file), fmt, ## __VA_ARGS__) +#define FPRINTF(file, fmt, ...) XPRINTF(/*no_cast*/(file), fmt, ## __VA_ARGS__) #define FSCANF(file, fmt, ...) XSCANF(no_cast(file), fmt, ## __VA_ARGS__) #define PRINTF(fmt, ...) FPRINTF(stdout, fmt, ## __VA_ARGS__) #define SPRINTF(str, fmt, ...) XPRINTF(base_cast(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 \ + (/*[&]() -> VString*/ \ { \ VString _out_impl; \ SNPRINTF(_out_impl, n, fmt, ## __VA_ARGS__);\ - return _out_impl; \ - }()) + /*return*/ _out_impl; \ + }/*()*/) } // namespace cxxstdio -- cgit v1.2.3-70-g09d2