aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bdep/project.cxx2
-rw-r--r--bdep/project.hxx10
-rw-r--r--bdep/wrapper-traits.hxx12
3 files changed, 18 insertions, 6 deletions
diff --git a/bdep/project.cxx b/bdep/project.cxx
index 64f82ca..6b5ee30 100644
--- a/bdep/project.cxx
+++ b/bdep/project.cxx
@@ -240,7 +240,7 @@ namespace bdep
{
// Name is to be extracted later.
//
- r.packages.push_back (move (package_location {"", *p.package}));
+ r.packages.push_back (package_location {"", *p.package});
}
}
diff --git a/bdep/project.hxx b/bdep/project.hxx
index 9e68108..2b1894c 100644
--- a/bdep/project.hxx
+++ b/bdep/project.hxx
@@ -26,6 +26,8 @@ void assert (int);
namespace bdep
{
+ using optional_uint64_t = optional<uint64_t>;
+
using optional_string = optional<string>;
using optional_dir_path = optional<dir_path>;
@@ -70,12 +72,10 @@ namespace bdep
// Since it is not always possible to derive a relative path, it is
// optional.
//
- using id_type = optional<uint64_t>;
-
- id_type id;
- optional<string> name;
+ optional_uint64_t id;
+ optional_string name;
dir_path path;
- optional<dir_path> relative_path;
+ optional_dir_path relative_path;
bool default_;
diff --git a/bdep/wrapper-traits.hxx b/bdep/wrapper-traits.hxx
index 80b0cff..f4479f7 100644
--- a/bdep/wrapper-traits.hxx
+++ b/bdep/wrapper-traits.hxx
@@ -5,6 +5,8 @@
#ifndef BDEP_WRAPPER_TRAITS_HXX
#define BDEP_WRAPPER_TRAITS_HXX
+#include <cstdint>
+
#include <libbutl/optional.mxx>
#include <odb/wrapper-traits.hxx>
@@ -54,6 +56,16 @@ namespace odb
return const_cast<unrestricted_wrapped_type&> (*o);
}
};
+
+ // These magic incantations are necessary to get portable generated
+ // code (without these because of the way GCC works uint64_t will be
+ // spelled as unsigned long which will break on Windows).
+ //
+ using optional_uint64_t = butl::optional<std::uint64_t>;
+ using optional_uint64_traits = odb::wrapper_traits<optional_uint64_t>;
+#ifdef ODB_COMPILER
+ template class odb::wrapper_traits<optional_uint64_t>;
+#endif
}
#endif // BDEP_WRAPPER_TRAITS_HXX