aboutsummaryrefslogtreecommitdiff
path: root/libbutl/regex.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-22 23:32:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-22 23:32:28 +0200
commitc09cd7512491cee1e82c1ad8128ce9fd4bc3f79b (patch)
treea659ed768d849130ab5780a11b7f791a463a1a91 /libbutl/regex.cxx
parent2a00871f07067f8f9e2de08bb9c8f50e1bf6a650 (diff)
Initial modularization with both Clang and VC hacks
Note: gave up on VC about half way though.
Diffstat (limited to 'libbutl/regex.cxx')
-rw-r--r--libbutl/regex.cxx35
1 files changed, 30 insertions, 5 deletions
diff --git a/libbutl/regex.cxx b/libbutl/regex.cxx
index a177a74..1da325b 100644
--- a/libbutl/regex.cxx
+++ b/libbutl/regex.cxx
@@ -2,17 +2,42 @@
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
-#include <libbutl/regex.hxx>
-
-#if defined(_MSC_VER) && _MSC_VER <= 1911
-# include <cstring> // strstr()
+#ifndef __cpp_modules
+#include <libbutl/regex.mxx>
#endif
+// C includes.
+
+#ifndef __cpp_lib_modules
+#include <regex>
+#include <string>
+
#include <ostream>
#include <sstream>
#include <stdexcept> // runtime_error
+#if defined(_MSC_VER) && _MSC_VER <= 1911
+# include <cstring> // strstr()
+#endif
+#endif
+
+// Other includes.
-#include <libbutl/utility.hxx> // operator<<(ostream, exception)
+#ifdef __cpp_modules
+module butl.regex;
+
+// Only imports additional to interface.
+#ifdef __clang__
+#ifdef __cpp_lib_modules
+import std.core;
+import std.io;
+//@@ MOD TODO import std.regex;
+#endif
+#endif
+
+import butl.utility; // operator<<(ostream, exception)
+#else
+#include <libbutl/utility.mxx>
+#endif
namespace std
{