Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+35 -5
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ios.cc 70021 2013-05-22 07:55:29Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -37,10 +37,40 @@
#include "G4ios.hh"
#include "G4strstreambuf.hh"
G4strstreambuf G4coutbuf;
G4strstreambuf G4cerrbuf;
std::ostream G4cout(&G4coutbuf);
std::ostream G4cerr(&G4cerrbuf);
#ifdef G4MULTITHREADED
G4ThreadLocal G4strstreambuf *G4coutbuf_p = 0;
G4ThreadLocal G4strstreambuf *G4cerrbuf_p = 0;
G4ThreadLocal std::ostream *G4cout_p = 0;
G4ThreadLocal std::ostream *G4cerr_p = 0;
#define G4coutbuf (*G4coutbuf_p)
#define G4cerrbuf (*G4cerrbuf_p)
#define G4cout (*G4cout_p)
#define G4cerr (*G4cerr_p)
void G4iosInitialization()
{
if (G4coutbuf_p == 0) G4coutbuf_p = new G4strstreambuf;
if (G4cerrbuf_p == 0) G4cerrbuf_p = new G4strstreambuf;
if (G4cout_p == 0) G4cout_p = new std::ostream(G4coutbuf_p);
if (G4cerr_p == 0) G4cerr_p = new std::ostream(G4cerrbuf_p);
}
void G4iosFinalization()
{
delete G4cout_p;
delete G4cerr_p;
delete G4coutbuf_p;
delete G4cerrbuf_p;
}
#else // Sequential
G4strstreambuf G4coutbuf;
G4strstreambuf G4cerrbuf;
std::ostream G4cout(&G4coutbuf);
std::ostream G4cerr(&G4cerrbuf);
void G4iosInitialization() {}
void G4iosFinalization() {}
#endif