Salome HOME
- Major update for launcher:
[modules/kernel.git] / src / Launcher / SALOME_LauncherServer.cxx
index 5913d0ffb129d58c45fb19223bf5a3ad73072e99..4a4912b9314f1b07a444606edcc74dd8acd87320 100644 (file)
@@ -1,22 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include "SALOME_Launcher.hxx"
 #include "utilities.h"
 #include <sstream>
 #include <stdexcept>
 #include <libxml/parser.h>
 
-using namespace std;
-
 void AttachDebugger()
 {
+#ifndef WIN32
   if(getenv ("DEBUGGER"))
     {
       std::stringstream exec;
       exec << "$DEBUGGER SALOME_LauncherServer " << getpid() << "&";
-      std::cerr << exec.str() << std::endl;
+      MESSAGE ( exec.str() );
       system(exec.str().c_str());
       while(1);
     }
+#endif
 }
 
 void terminateHandler(void)
 {
-  std::cerr << "Terminate: not managed exception !"  << std::endl;
+  MESSAGE ( "Terminate: not managed exception !"  );
   AttachDebugger();
 }
 
 void unexpectedHandler(void)
 {
-  std::cerr << "Unexpected: unexpected exception !"  << std::endl;
+  MESSAGE ( "Unexpected: unexpected exception !"  );
   AttachDebugger();
 }
 
@@ -56,8 +59,8 @@ int main(int argc, char* argv[])
   if(getenv ("DEBUGGER"))
     {
 //       setsig(SIGSEGV,&Handler);
-      set_terminate(&terminateHandler);
-      set_unexpected(&unexpectedHandler);
+      std::set_terminate(&terminateHandler);
+      std::set_unexpected(&unexpectedHandler);
     }
   /* Init libxml 
    * To avoid memory leak, need to call xmlInitParser in the main thread