diff --git a/include/ircd/stdinc.h b/include/ircd/stdinc.h index 34c0da9c8..22e05d9ed 100644 --- a/include/ircd/stdinc.h +++ b/include/ircd/stdinc.h @@ -78,7 +78,7 @@ extern "C" #include is not +// included here because it generates naive initialization code in every unit, +// whereas we conduct it once for libircd in the right place. +namespace std +{ + extern istream cin; + extern ostream cout; + extern ostream cerr; +} + // OpenSSL // Additional forward declarations in the extern namespace are introduced // by ircd/openssl.h diff --git a/ircd/logger.cc b/ircd/logger.cc index ccf7e2adb..64be9711d 100644 --- a/ircd/logger.cc +++ b/ircd/logger.cc @@ -8,6 +8,10 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. +#include inclusion here runs std::ios_base::Init() statically as this unit +// is initialized (GNU initialization order given in Makefile). + namespace ircd::log { // Option toggles