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/filesystem.cxx | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'libbutl/filesystem.cxx') diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx index 7ba5275..8c3abc4 100644 --- a/libbutl/filesystem.cxx +++ b/libbutl/filesystem.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 // rename() @@ -25,25 +29,46 @@ # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # endif - -# include // lcase() #endif -#include // errno, E* +#include + +#ifndef __cpp_lib_modules +#include +#include +#include +#include +#include #include #include #include // unique_ptr -#include // size_t -#include // pair -#include // reverse_iterator #include +#endif +// Other includes. -#include -#include // throw_generic_error() -#include -#include +#ifdef __cpp_modules +module butl.filesystem; + +// Only imports additional to interface. +#ifdef __clang__ +#ifdef __cpp_lib_modules +import std.core; +#endif +import butl.path; +import butl.timestamp; +#endif + +import butl.utility; // throw_generic_error(), lcase()[_WIN32] +import butl.fdstream; +import butl.small_vector; +#else +#include +#include +#include +#include +#endif using namespace std; -- cgit v1.1