From c09cd7512491cee1e82c1ad8128ce9fd4bc3f79b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Sep 2017 23:32:28 +0200 Subject: Initial modularization with both Clang and VC hacks Note: gave up on VC about half way though. --- libbutl/fdstream.cxx | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'libbutl/fdstream.cxx') diff --git a/libbutl/fdstream.cxx b/libbutl/fdstream.cxx index ab78e6a..905c36f 100644 --- a/libbutl/fdstream.cxx +++ b/libbutl/fdstream.cxx @@ -2,7 +2,11 @@ // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file -#include +#ifndef __cpp_modules +#include +#endif + +#include // errno, E* #ifndef _WIN32 # include // open(), O_*, fcntl() @@ -21,23 +25,46 @@ # include // _O_* # include // S_I* -# include // wcsncmp(), wcsstr() +# include // wcsncmp(), wcsstr() #endif -#include // errno, E* +#include + +#ifndef __cpp_lib_modules +#include +#include +#include +#include +#include +#include #include // ios_base::openmode, ios_base::failure #include // bad_alloc #include // numeric_limits -#include #include // memcpy(), memmove() #include // uncaught_exception() #include // invalid_argument #include #include +#endif #include +#ifdef __cpp_modules +module butl.fdstream; + +// Only imports additional to interface. +#ifdef __clang__ +#ifdef __cpp_lib_modules +import std.core; +import std.io; +#endif +import butl.path; +import butl.filesystem; +#endif + +#endif + using namespace std; #ifdef _WIN32 -- cgit v1.1