aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-03-20 09:53:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-03-20 09:53:23 +0200
commit5bb3ef9047bda0f30142fd96112ee00a1c64d2a1 (patch)
tree9ac505c7ff5dfef20b34d1276c039c1671f33df2 /libbuild2
parente94354ceef93f45b0a95f35eee62750876ec936b (diff)
Reorder inline functions to get rid of MinGW GCC dllimport warnings
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/file-cache.ixx146
1 files changed, 73 insertions, 73 deletions
diff --git a/libbuild2/file-cache.ixx b/libbuild2/file-cache.ixx
index 1a01410..8385c90 100644
--- a/libbuild2/file-cache.ixx
+++ b/libbuild2/file-cache.ixx
@@ -3,72 +3,27 @@
namespace build2
{
- // file_cache::write
- //
- inline void file_cache::write::
- close ()
- {
- entry_->state_ = entry::uncomp;
- }
-
- inline file_cache::write::
- ~write ()
- {
- if (entry_ != nullptr)
- entry_->unpin ();
- }
-
- inline file_cache::write::
- write (write&& e)
- : entry_ (e.entry_)
- {
- e.entry_ = nullptr;
- }
-
- inline file_cache::write& file_cache::write::
- operator= (write&& e)
- {
- if (this != &e)
- {
- assert (entry_ == nullptr);
- swap (entry_, e.entry_);
- }
- return *this;
- }
-
- // file_cache::read
+ // file_cache::entry
//
- inline file_cache::read::
- ~read ()
- {
- if (entry_ != nullptr)
- entry_->unpin ();
- }
-
- inline file_cache::read::
- read (read&& e)
- : entry_ (e.entry_)
+ inline const path& file_cache::entry::
+ path () const
{
- e.entry_ = nullptr;
+ return path_;
}
- inline file_cache::read& file_cache::read::
- operator= (read&& e)
+ inline void file_cache::entry::
+ pin ()
{
- if (this != &e)
- {
- assert (entry_ == nullptr);
- swap (entry_, e.entry_);
- }
- return *this;
+ ++pin_;
}
- // file_cache::entry
- //
- inline const path& file_cache::entry::
- path () const
+ inline void file_cache::entry::
+ unpin ()
{
- return path_;
+ if (--pin_ == 0 &&
+ !comp_path_.empty () &&
+ (state_ == uncomp || state_ == decomp))
+ preempt ();
}
inline file_cache::read file_cache::entry::
@@ -86,21 +41,6 @@ namespace build2
return read (*this);
}
- inline void file_cache::entry::
- pin ()
- {
- ++pin_;
- }
-
- inline void file_cache::entry::
- unpin ()
- {
- if (--pin_ == 0 &&
- !comp_path_.empty () &&
- (state_ == uncomp || state_ == decomp))
- preempt ();
- }
-
inline file_cache::entry::
operator bool () const
{
@@ -149,6 +89,66 @@ namespace build2
return *this;
}
+ // file_cache::write
+ //
+ inline void file_cache::write::
+ close ()
+ {
+ entry_->state_ = entry::uncomp;
+ }
+
+ inline file_cache::write::
+ ~write ()
+ {
+ if (entry_ != nullptr)
+ entry_->unpin ();
+ }
+
+ inline file_cache::write::
+ write (write&& e)
+ : entry_ (e.entry_)
+ {
+ e.entry_ = nullptr;
+ }
+
+ inline file_cache::write& file_cache::write::
+ operator= (write&& e)
+ {
+ if (this != &e)
+ {
+ assert (entry_ == nullptr);
+ swap (entry_, e.entry_);
+ }
+ return *this;
+ }
+
+ // file_cache::read
+ //
+ inline file_cache::read::
+ ~read ()
+ {
+ if (entry_ != nullptr)
+ entry_->unpin ();
+ }
+
+ inline file_cache::read::
+ read (read&& e)
+ : entry_ (e.entry_)
+ {
+ e.entry_ = nullptr;
+ }
+
+ inline file_cache::read& file_cache::read::
+ operator= (read&& e)
+ {
+ if (this != &e)
+ {
+ assert (entry_ == nullptr);
+ swap (entry_, e.entry_);
+ }
+ return *this;
+ }
+
// file_cache
//
inline file_cache::entry file_cache::