aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-03-12 05:36:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-03-12 05:36:09 +0200
commit5bdce34d722233ea81557d02ebe213cc83cf4d7a (patch)
treeef2f3b6c0c251cadd52b948804b79b01391782be
parent6acb9d258a4299228a78db8f04ff6ad2fa79eeee (diff)
Fix compile errors for older GCC and Clang
-rw-r--r--bpkg/system-package-manager-debian.cxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx
index 3037730..7be5be5 100644
--- a/bpkg/system-package-manager-debian.cxx
+++ b/bpkg/system-package-manager-debian.cxx
@@ -2995,13 +2995,19 @@ namespace bpkg
const path* cur_install (nullptr); // File being opened/written to.
try
{
- pair<path&, ofdstream> main (main_install, auto_fd ());
- pair<path&, ofdstream> dev (dev_install, auto_fd ());
- pair<path&, ofdstream> doc (doc_install, auto_fd ());
- pair<path&, ofdstream> dbg (dbg_install, auto_fd ());
- pair<path&, ofdstream> com (common_install, auto_fd ());
-
- auto open = [&deb, &cur_install] (pair<path&, ofdstream>& os,
+ ofdstream main_os;
+ ofdstream dev_os;
+ ofdstream doc_os;
+ ofdstream dbg_os;
+ ofdstream com_os;
+
+ pair<path&, ofdstream&> main (main_install, main_os);
+ pair<path&, ofdstream&> dev (dev_install, dev_os);
+ pair<path&, ofdstream&> doc (doc_install, doc_os);
+ pair<path&, ofdstream&> dbg (dbg_install, dbg_os);
+ pair<path&, ofdstream&> com (common_install, com_os);
+
+ auto open = [&deb, &cur_install] (pair<path&, ofdstream&>& os,
const string& n)
{
if (!n.empty ())
@@ -3017,12 +3023,12 @@ namespace bpkg
open (dbg, st.dbg);
open (com, st.common);
- auto is_open = [] (pair<path&, ofdstream>& os)
+ auto is_open = [] (pair<path&, ofdstream&>& os)
{
return os.second.is_open ();
};
- auto add = [&cur_install] (pair<path&, ofdstream>& os, const path& p)
+ auto add = [&cur_install] (pair<path&, ofdstream&>& os, const path& p)
{
// Strip root.
//
@@ -3201,7 +3207,7 @@ namespace bpkg
// Close.
//
- auto close = [&cur_install] (pair<path&, ofdstream>& os)
+ auto close = [&cur_install] (pair<path&, ofdstream&>& os)
{
if (os.second.is_open ())
{