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/diagnostics.cxx | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'libbutl/diagnostics.cxx') diff --git a/libbutl/diagnostics.cxx b/libbutl/diagnostics.cxx index 33d8e3a..6189775 100644 --- a/libbutl/diagnostics.cxx +++ b/libbutl/diagnostics.cxx @@ -2,25 +2,52 @@ // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file -#include +#ifndef __cpp_modules +#include +#endif #ifndef _WIN32 # include // write() #else # include - # include //_write() #endif +#include + +#ifndef __cpp_lib_modules +#include +#include + #include // ios::failure #include #include -#include #include // size_t #include // cerr +#endif -#include -#include // stderr_fd(), fdterm() +// Other includes. + +#ifdef __cpp_modules +module butl.diagnostics; + +// Only imports additional to interface. +#ifdef __clang__ +#ifdef __cpp_lib_modules +import std.core; +import std.io; +#endif +#endif + +//@@ MOD TODO: std.threading +import butl.utility; +import butl.optional; +import butl.fdstream; // stderr_fd(), fdterm() +#else +#include +#include +#include +#endif using namespace std; -- cgit v1.1