From ec76db9e858357686885cd078e39350f66adcc9f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 19 Apr 2017 02:34:14 +0300 Subject: Reorder inline functions to keep MinGW GCC happy (export) --- butl/fdstream | 6 +++--- butl/fdstream.ixx | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'butl') diff --git a/butl/fdstream b/butl/fdstream index df6b3f1..afc3ef6 100644 --- a/butl/fdstream +++ b/butl/fdstream @@ -110,7 +110,7 @@ namespace butl close () {fd_.close ();} auto_fd - release () {return std::move (fd_);} + release (); void open (auto_fd&&); @@ -380,7 +380,7 @@ namespace butl open (auto_fd&& fd) {buf_.open (std::move (fd)); clear ();} void close (); - auto_fd release () {return buf_.release ();} // Note: no skipping. + auto_fd release (); // Note: no skipping. bool is_open () const {return buf_.is_open ();} private: @@ -458,7 +458,7 @@ namespace butl open (auto_fd&& fd) {buf_.open (std::move (fd)); clear ();} void close () {if (is_open ()) flush (); buf_.close ();} - auto_fd release () {if (is_open ()) flush (); return buf_.release ();} + auto_fd release (); bool is_open () const {return buf_.is_open ();} }; diff --git a/butl/fdstream.ixx b/butl/fdstream.ixx index 0d3d098..884d190 100644 --- a/butl/fdstream.ixx +++ b/butl/fdstream.ixx @@ -30,6 +30,14 @@ namespace butl reset (); } + // fdbuf + // + inline auto_fd fdbuf:: + release () + { + return std::move (fd_); + } + // ifdstream // inline ifdstream:: @@ -104,6 +112,12 @@ namespace butl open (f.string (), m); } + inline auto_fd ifdstream:: + release () + { + return buf_.release (); + } + // ofdstream // inline ofdstream:: @@ -176,6 +190,15 @@ namespace butl open (f.string (), m); } + inline auto_fd ofdstream:: + release () + { + if (is_open ()) + flush (); + + return buf_.release (); + } + // fdopen() // inline auto_fd -- cgit v1.1