Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2173)
@@ -10,6 +10,4 @@
 #pragma link C++ global kRad2Deg;
 //#pragma link C++ global kPI;
-
-#pragma link C++ function __omanip_debug;
 
 #pragma link C++ global gLog;
Index: trunk/MagicSoft/Mars/mbase/MClone.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 2173)
@@ -58,4 +58,6 @@
 
 ClassImp(MClone);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MContinue.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MContinue);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2173)
@@ -70,6 +70,5 @@
 
 #include <time.h>           // time_t
-#include <fstream.h>        // ofstream, SavePrimitive
-#include <iostream.h>
+#include <fstream>          // ofstream, SavePrimitive
 
 #include <TTime.h>          // TTime
@@ -91,4 +90,6 @@
 
 ClassImp(MEvtLoop);
+
+using namespace std;
 
 
Index: trunk/MagicSoft/Mars/mbase/MGList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 2173)
@@ -35,5 +35,5 @@
 #include "MGList.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TClass.h>
@@ -42,6 +42,7 @@
 #include <TGPicture.h>
 
-
 ClassImp(MGList);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -149,4 +150,5 @@
     if (IsExisting(obj))
     {
+        // FIXME: Replace by gLog
         const Int_t id = GetWidget(obj)->WidgetId();
         cout << "Widget with id #" << id << " (";
Index: trunk/MagicSoft/Mars/mbase/MGTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGTask.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MGTask.cc	(revision 2173)
@@ -41,4 +41,6 @@
 
 ClassImp(MGTask);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2173)
@@ -97,5 +97,5 @@
 
 #include <stdlib.h>     // mkstempe
-#include <fstream.h>
+#include <fstream>
 #ifdef _REENTRANT
 #include <pthread.h>
@@ -106,4 +106,6 @@
 
 ClassImp(MLog);
+
+using namespace std;
 
 // root 3.02:
@@ -210,10 +212,12 @@
 // copyt constructor
 //
-MLog::MLog(MLog &log)
-{
-    fOutputLevel = log.fOutputLevel;
-    fDebugLevel  = log.fDebugLevel;
-    fDevice      = log.fDevice;
-}
+/*
+MLog::MLog(MLog const& log)
+{
+//    fOutputLevel = log.fOutputLevel;
+//    fDebugLevel  = log.fDebugLevel;
+//    fDevice      = log.fDevice;
+}
+*/
 
 void MLog::Underline()
@@ -447,6 +451,7 @@
 void MLog::AllocateFile(const char *fname)
 {
+    // gcc 3.2:
     char *txt = (char*)"logXXXXXX";
-    fout = fname ? new ofstream(fname) : new ofstream(mkstemp(txt));
+    fout = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/);
     fOutAllocated = kTRUE;
 }
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2173)
@@ -9,10 +9,5 @@
 #endif
 
-#ifndef __CINT__
-#include <iostream.h>  // base classes for MLog
-#else
-class streambuf;
-class ostream;
-#endif
+#include <iostream>  // base classes for MLog
 
 #define bsz    160 // two standard lines
@@ -20,5 +15,5 @@
 class TGTextView;
 
-class MLog : public streambuf, public ostream, public TObject
+class MLog : public std::streambuf, public std::ostream, public TObject
 {
 public:
@@ -94,5 +89,10 @@
     MLog(const char *fname, int flag=-1);
 
-    MLog(MLog &log);
+    MLog(MLog const& log) : ostream((std::streambuf*)&log)
+    {
+        fOutputLevel = log.fOutputLevel;
+        fDebugLevel  = log.fDebugLevel;
+        fDevice      = log.fDevice;
+    }
     ~MLog();
 
@@ -186,5 +186,5 @@
         const int save = fOutputLevel;
         SetOutputLevel(outlvl);
-        (*this) << str << endl;
+        (*this) << str << std::endl;
         fOutputLevel = save;
     }
Index: trunk/MagicSoft/Mars/mbase/MLogManip.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogManip.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MLogManip.cc	(revision 2173)
@@ -25,5 +25,5 @@
 #include "MLog.h"
 #include "MLogManip.h"
-
+/*
 // ----------------------------------------------------------------
 //            Definitions of the manipulator functions
@@ -124,3 +124,3 @@
     return lout;
 }
-
+*/
Index: trunk/MagicSoft/Mars/mbase/MLogManip.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 2173)
@@ -2,59 +2,83 @@
 #define MARS_MLogManip
 
-#include <iomanip.h>
+#include <iomanip>
 
-// ----------------------------------------------------------------
-//                 Definitions of the manipulators
-// ----------------------------------------------------------------
+#include "MLog.h"
 
-//
-// define a general simple macro for manipulator definitions (int)
-//
-#define MANIPULATOR0(name) \
-   extern ostream& ##name(ostream& lout);
+// --------------------- simple manipulators -----------------------
 
-#ifndef OMANIP
-   #define MANIPULATOR1(name) \
-      extern ostream& __omanip_##name(ostream& lout, int i); \
-      inline omanip<int> ##name(int i)                \
-      {                                               \
-         return omanip<int>(__omanip_##name, i);     \
-      }
+enum MLogManip {
+    underline
+};
 
-#else
-   #define MANIPULATOR1(name) \
-       extern ostream& __omanip_##name(ostream& lout, int i); \
-       inline OMANIP(int) ##name(int i)                \
-       {                                               \
-          return OMANIP(int)(__omanip_##name, i);      \
-       }
+inline std::ostream &operator<<(std::ostream &lout, MLogManip u)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->Underline();
+    return lout;
+}
 
-#endif
 
-//
-// definitions
-//
-MANIPULATOR0(underline); // underline output
-MANIPULATOR1(debug);     // set debug level
-MANIPULATOR1(device);    // set ouput devices
-MANIPULATOR1(edev);      // enable additional output devices
-MANIPULATOR1(ddev);      // disable given output
-//#ifndef __CINT__
-//__DEFINE_IOMANIP_FN1(smanip, int, debug);    // set debug level
-//__DEFINE_IOMANIP_FN1(smanip, int, device);   // set ouput devices
-//__DEFINE_IOMANIP_FN1(smanip, int, edev);     // enable additional output devices
-//__DEFINE_IOMANIP_FN1(smanip, int, ddev);     // disable given output
-//#endif
+// ----------------------------- debug -----------------------------
 
-// ----------------------------------------------------------------
-//                         Debug helper macros
-// ----------------------------------------------------------------
+struct _Debug { int level; };
 
-//
-// Output debug information into the stream
-//  - this can only be done by a macro
-//
+inline _Debug debug(int level)
+{
+    _Debug d;
+    d.level = level;
+    return d;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _Debug d)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->SetOutputLevel(d.level);
+    return lout;
+}
+
+// ------------------------------- edev ----------------------------
+
+struct _EnableDev { MLog::_flags dev; };
+
+inline _EnableDev edev(MLog::_flags i)
+{
+    _EnableDev e;
+    e.dev = i;
+    return e;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _EnableDev e)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->EnableOutputDevice(e.dev);
+    return lout;
+}
+
+// ------------------------------- sdev ----------------------------
+
+struct _DisableDev { MLog::_flags dev; };
+
+inline _DisableDev ddev(MLog::_flags i)
+{
+    _DisableDev d;
+    d.dev = i;
+    return d;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _DisableDev d)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->EnableOutputDevice(d.dev);
+    return lout;
+}
+
+// ------------------------------ Macros ---------------------------
+
 #ifndef __CINT__
-//#define dbginf dbg << __FILE__ << " l." << dec << __LINE__ << ": "
 #define dbginf __FILE__ << " l." << dec << __LINE__ << ": "
 #define all    debug(0) // use this for output in any case
@@ -64,35 +88,4 @@
 #define dbg    debug(4) // use this for debug messages (blue)
 #endif
-//
-// flush the old buffer, set a new debug level
-// and output the debug information code
-//
-// Be careful: Only use them with a MLogging stream facility.
-// Remark:     All this is compiled into the code.
-//
-/*
-#ifndef __CINT__
-#define DEBUG(lvl)  flush << debug(lvl) << dbginf
-#endif
-*/
-/*
-class SMANIP(T) {
-    ios& (*fct)(ios&,T) ;
-    T arg ;
-public:
-    SMANIP(T)(ios& (*f)(ios&, T), T a) :
-        fct(f), arg(a) { }
-        friend istream& operator>>(istream& i, const SMANIP(T)& m)
-        {
-            ios* s = &i ;
-            (*m.fct)(*s,m.arg) ; return i ;
-        }
-        friend ostream& operator<<(ostream& o, const SMANIP(T)& m)
-        {
-            ios* s = &o ;
-            (*m.fct)(*s,m.arg) ; return o ;
-        }
-} ;
-*/
 
 #endif
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2173)
@@ -38,5 +38,5 @@
 
 #include <ctype.h>        // isdigit
-#include <fstream.h>      // ofstream, AsciiWrite
+#include <fstream>        // ofstream, AsciiWrite
 
 #include <TEnv.h>         // Env::Lookup
@@ -58,4 +58,6 @@
 
 ClassImp(MParContainer);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2173)
@@ -20,6 +20,8 @@
 #endif
 
-class ofstream;
-class ifstream;
+// gcc 3.2
+#include <iosfwd>
+//class ofstream;
+//class ifstream;
 
 class TEnv;
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2173)
@@ -41,5 +41,5 @@
 #include "MParList.h"
 
-#include <fstream.h>     // ofstream, SavePrimitive
+#include <fstream>     // ofstream, SavePrimitive
 
 #include <TNamed.h>
@@ -53,4 +53,6 @@
 
 ClassImp(MParList);
+
+using namespace std;
 
 static const TString gsDefName  = "MParList";
Index: trunk/MagicSoft/Mars/mbase/MPrint.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 2173)
@@ -46,4 +46,6 @@
 
 ClassImp(MPrint);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2173)
@@ -68,5 +68,5 @@
 #include "MTask.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <TBaseClass.h>
 
@@ -79,4 +79,6 @@
 
 ClassImp(MTask);
+
+using namespace std;
 
 MTask::MTask(const char *name, const char *title)
Index: trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2173)
@@ -36,6 +36,4 @@
 #include "MTaskInteractive.h"
 
-#include <iostream.h>
-
 #include <Api.h>
 #include <TMethodCall.h>
@@ -45,4 +43,6 @@
 
 ClassImp(MTaskInteractive);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2173)
@@ -57,5 +57,5 @@
 #include "MTaskList.h"
 
-#include <fstream.h>        // ofstream, SavePrimitive
+#include <fstream>        // ofstream, SavePrimitive
 
 #include <TClass.h>
@@ -73,4 +73,6 @@
 
 ClassImp(MTaskList);
+
+using namespace std;
 
 const TString MTaskList::gsDefName  = "MTaskList";
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2161)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2173)
@@ -33,9 +33,11 @@
 #include "MTime.h"
 
-#include <iomanip.h>
+#include <iomanip>
 
 #include "MLog.h"
 
 ClassImp(MTime);
+
+using namespace std;
 
 void MTime::Print(Option_t *) const
