diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-08 19:00:34 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-08 19:54:26 -0800 |
commit | f2fd4885c2a906414e0f36acf95d252e5a9d5805 (patch) | |
tree | 918bff247135e9223a5126f1b85f4ae4fc9ba1aa /src/common/cxxstdio.hpp | |
parent | 3e42921c657bc93094f0c7d96855aae9b0be5a7e (diff) | |
download | tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.gz tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.bz2 tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.xz tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.zip |
Improve warning management more
Diffstat (limited to 'src/common/cxxstdio.hpp')
-rw-r--r-- | src/common/cxxstdio.hpp | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/common/cxxstdio.hpp b/src/common/cxxstdio.hpp index d7c0634..866947c 100644 --- a/src/common/cxxstdio.hpp +++ b/src/common/cxxstdio.hpp @@ -67,6 +67,7 @@ namespace cxxstdio return vsscanf(in, fmt, ap); } #else + inline int do_vscan(const char *, const char *, va_list) = delete; #endif @@ -262,39 +263,39 @@ namespace cxxstdio } }; -#define FPRINTF(file, fmt, args...) \ - ([&]() -> int \ - { \ - struct format_impl \ - { \ - constexpr static \ - const char *print_format() { return fmt; } \ - }; \ - return cxxstdio::PrintFormatter<format_impl>::print(file, ## args);\ +#define FPRINTF(file, fmt, ...) \ + ([&]() -> int \ + { \ + struct format_impl \ + { \ + constexpr static \ + const char *print_format() { return fmt; } \ + }; \ + return cxxstdio::PrintFormatter<format_impl>::print(file, ## __VA_ARGS__); \ }()) -#define FSCANF(file, fmt, args...) \ - ([&]() -> int \ - { \ - struct format_impl \ - { \ - constexpr static \ - const char *scan_format() { return fmt; } \ - }; \ - return cxxstdio::ScanFormatter<format_impl>::scan(file, ## args); \ +#define FSCANF(file, fmt, ...) \ + ([&]() -> int \ + { \ + struct format_impl \ + { \ + constexpr static \ + const char *scan_format() { return fmt; } \ + }; \ + return cxxstdio::ScanFormatter<format_impl>::scan(file, ## __VA_ARGS__); \ }()) -#define PRINTF(fmt, args...) FPRINTF(stdout, fmt, ## args) -#define SPRINTF(str, fmt, args...) FPRINTF(str, fmt, ## args) -#define SCANF(fmt, args...) FSCANF(stdin, fmt, ## args) -#define SSCANF(str, fmt, args...) FSCANF(str, fmt, ## args) - -#define STRPRINTF(fmt, args...) \ - ([&]() -> std::string \ - { \ - std::string _out_impl; \ - SPRINTF(_out_impl, fmt, ## args); \ - return _out_impl; \ +#define PRINTF(fmt, ...) FPRINTF(stdout, fmt, ## __VA_ARGS__) +#define SPRINTF(str, fmt, ...) FPRINTF(str, fmt, ## __VA_ARGS__) +#define SCANF(fmt, ...) FSCANF(stdin, fmt, ## __VA_ARGS__) +#define SSCANF(str, fmt, ...) FSCANF(str, fmt, ## __VA_ARGS__) + +#define STRPRINTF(fmt, ...) \ + ([&]() -> std::string \ + { \ + std::string _out_impl; \ + SPRINTF(_out_impl, fmt, ## __VA_ARGS__);\ + return _out_impl; \ }()) } // namespace cxxstdio |