aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-23 00:14:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-23 00:14:37 +0200
commit63d2400a2c1cff42a8e3ea3d8b4c77b862c82bc7 (patch)
tree6c86fc57033b472818bdc89c873b204d8fafbc6e
parentc09cd7512491cee1e82c1ad8128ce9fd4bc3f79b (diff)
Undo modularization hacks for VC
-rw-r--r--libbutl/buildfile2
-rw-r--r--libbutl/fdstream.mxx5
-rw-r--r--libbutl/optional.mxx2
-rw-r--r--libbutl/path.cxx3
-rw-r--r--libbutl/path.ixx8
-rw-r--r--libbutl/path.mxx12
-rw-r--r--libbutl/path.txx1
-rw-r--r--libbutl/sha256.cxx9
-rw-r--r--libbutl/target-triplet.mxx3
-rw-r--r--libbutl/utility.mxx10
10 files changed, 21 insertions, 34 deletions
diff --git a/libbutl/buildfile b/libbutl/buildfile
index 6086fd7..ccf8908 100644
--- a/libbutl/buildfile
+++ b/libbutl/buildfile
@@ -62,7 +62,7 @@ if ($cxx.target.class == "windows")
else
cxx.libs += -lpthread
-#@@ MOD bogus warning if module and dll-exported function called within DLL.
+#@@ MOD VC bogus warning if module and dll-exported function called within DLL.
#
if ($cxx.features.modules && $cxx.id == 'msvc')
cxx.loptions += /ignore:4217
diff --git a/libbutl/fdstream.mxx b/libbutl/fdstream.mxx
index f84b88e..b2d4704 100644
--- a/libbutl/fdstream.mxx
+++ b/libbutl/fdstream.mxx
@@ -46,10 +46,9 @@ LIBBUTL_MODEXPORT namespace butl
//
struct nullfd_t {constexpr explicit nullfd_t (int) {}};
#if defined(__cpp_modules) && defined(__clang__) //@@ MOD Clang duplicate sym.
- inline constexpr nullfd_t nullfd (-1);
-#else
- const/*expr*/ nullfd_t nullfd (-1); //@@ MOD VC multiple defs.
+ inline
#endif
+ constexpr nullfd_t nullfd (-1);
class LIBBUTL_SYMEXPORT auto_fd
{
diff --git a/libbutl/optional.mxx b/libbutl/optional.mxx
index 4478f84..b0993d9 100644
--- a/libbutl/optional.mxx
+++ b/libbutl/optional.mxx
@@ -32,7 +32,7 @@ LIBBUTL_MODEXPORT namespace butl
#if defined(__cpp_modules) && defined(__clang__) //@@ MOD Clang duplicate sym.
inline
#endif
- const/*expr*/ nullopt_t nullopt (1); //@@ MOD VC multiple defs.
+ constexpr nullopt_t nullopt (1);
template <typename T>
class optional
diff --git a/libbutl/path.cxx b/libbutl/path.cxx
index bbc4754..ac85016 100644
--- a/libbutl/path.cxx
+++ b/libbutl/path.cxx
@@ -112,8 +112,7 @@ namespace butl
string_type const& d (
!root (s)
? s
- //@@ MOD VC ADL does not seem to kick in for some reason...
- : string_type (std::operator+ (s, directory_separator)));
+ : string_type (s + directory_separator));
if (_chdir (d.c_str ()) != 0)
throw_generic_error (errno);
diff --git a/libbutl/path.ixx b/libbutl/path.ixx
index f983f5d..f86a57e 100644
--- a/libbutl/path.ixx
+++ b/libbutl/path.ixx
@@ -6,21 +6,17 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
{
#ifdef _WIN32
template <>
- LIBBUTL_SYMEXPORT //@@ MOD VC needs it for some reason.
inline char path_traits<char>::
tolower (char c)
{
- //@@ MOD VC-ICE return lcase (c);
- return std::tolower (c);
+ return lcase (c);
}
template <>
- LIBBUTL_SYMEXPORT //@@ MOD VC needs it for some reason.
inline char path_traits<char>::
toupper (char c)
{
- //@@ MOD VC-ICE return ucase (c);
- return std::toupper (c);
+ return ucase (c);
}
#endif
diff --git a/libbutl/path.mxx b/libbutl/path.mxx
index 31101fc..4d843e5 100644
--- a/libbutl/path.mxx
+++ b/libbutl/path.mxx
@@ -18,7 +18,6 @@
#include <vector>
#ifdef _WIN32
-#include <cctype> // toupper/lower() @@ MOD TMP
#include <algorithm> // replace()
#endif
#endif
@@ -548,8 +547,6 @@ LIBBUTL_MODEXPORT namespace butl
base_type (path_data<C>&& d): path_data<C> (std::move (d)) {}
};
- //using base_type = path_data<C>; // @@ MOD VC-ICE
-
using dir_type = basic_path<C, dir_path_kind<C>>;
// Init and cast.
@@ -590,8 +587,6 @@ LIBBUTL_MODEXPORT namespace butl
cast (data_type&);
};
- struct exact_path_type {}; //@@ MOD TMP
-
template <typename C, typename K>
class basic_path: public K::base_type
{
@@ -638,9 +633,8 @@ LIBBUTL_MODEXPORT namespace butl
// untouched. Note that no exception is thrown if the path is invalid. See
// also representation()&& below.
//
- //@@ MOD VC-ICE enum exact_type {exact};
- static const exact_path_type exact;
- basic_path (string_type&& s, exact_path_type)
+ enum exact_type {exact};
+ basic_path (string_type&& s, exact_type)
: base_type (K::init (std::move (s), true)) {}
// Create a path as a sub-path identified by the [begin, end) range of
@@ -1084,9 +1078,7 @@ LIBBUTL_MODEXPORT namespace butl
explicit
basic_path (data_type&& d): base_type (std::move (d)) {}
- #ifndef _MSC_VER //@@ MOD VC ICE
using base_type::_size;
- #endif
// Common implementation for operator/= and operator+=.
//
diff --git a/libbutl/path.txx b/libbutl/path.txx
index 512e849..061728e 100644
--- a/libbutl/path.txx
+++ b/libbutl/path.txx
@@ -131,7 +131,6 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
// Throw system_error in case of other failures. Result and dir can be the
// same instance.
//
- LIBBUTL_MODEXPORT //@@ MOD VC doesn't "see" it in impl unit unless exported.
template <typename C>
bool
basic_path_append_actual_name (std::basic_string<C>& result,
diff --git a/libbutl/sha256.cxx b/libbutl/sha256.cxx
index b0b7301..be29871 100644
--- a/libbutl/sha256.cxx
+++ b/libbutl/sha256.cxx
@@ -32,7 +32,7 @@ extern "C"
#include <cstddef>
#include <cstdint>
-#include <cctype> // isxdigit(), toupper(), tolower()
+#include <cctype> // isxdigit()
#include <stdexcept> // invalid_argument
#endif
@@ -52,6 +52,9 @@ import std.core;
#endif
#endif
+import butl.utility; // *case()
+#else
+#include <libbutl/utility.mxx>
#endif
using namespace std;
@@ -128,7 +131,7 @@ namespace butl
if (i > 0 && i % 2 == 0)
f += ":";
- f += toupper (c); //@@ MOD revert to ucase()
+ f += ucase (c);
}
return f;
@@ -158,7 +161,7 @@ namespace butl
if (!isxdigit (c))
bad ();
- s += tolower (c); //@@ MOD revert to lcase()
+ s += lcase (c);
}
}
diff --git a/libbutl/target-triplet.mxx b/libbutl/target-triplet.mxx
index 9445aba..0b2c40a 100644
--- a/libbutl/target-triplet.mxx
+++ b/libbutl/target-triplet.mxx
@@ -145,8 +145,7 @@ LIBBUTL_MODEXPORT namespace butl
explicit
target_triplet (const std::string&);
- //target_triplet () = default;
- target_triplet () {} //@@ MOD (VC ICE)
+ target_triplet () = default;
};
inline bool
diff --git a/libbutl/utility.mxx b/libbutl/utility.mxx
index 6a50186..d36b0d9 100644
--- a/libbutl/utility.mxx
+++ b/libbutl/utility.mxx
@@ -75,14 +75,14 @@ LIBBUTL_MODEXPORT namespace butl
// http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html#tag_07_02)
//
char ucase (char);
- std::string ucase (const char*, std::size_t = -1 /*@@ MOD VC ICE = std::string::npos*/);
+ std::string ucase (const char*, std::size_t = std::string::npos);
std::string ucase (const std::string&);
std::string& ucase (std::string&);
void ucase (char*, std::size_t);
char lcase (char);
- std::string lcase (const char*, std::size_t = -1 /*@@ MOD VC ICE = std::string::npos*/);
+ std::string lcase (const char*, std::size_t = std::string::npos);
std::string lcase (const std::string&);
std::string& lcase (std::string&);
void lcase (char*, std::size_t);
@@ -100,12 +100,12 @@ LIBBUTL_MODEXPORT namespace butl
int casecmp (char, char);
int casecmp (const std::string&, const std::string&,
- std::size_t = -1 /*@@ MOD VC ICE std::string::npos*/);
+ std::size_t = std::string::npos);
int casecmp (const std::string&, const char*,
- std::size_t = -1 /*@@ MOD VC ICE std::string::npos*/);
+ std::size_t = std::string::npos);
- int casecmp (const char*, const char*, std::size_t = -1 /*MOD VC ICE std::string::npos*/);
+ int casecmp (const char*, const char*, std::size_t = std::string::npos);
// Case-insensitive key comparators (i.e., to be used in sets, maps, etc).
//