| 
            Last change
 on this file since 3264 was             2615, checked in by cmv, 21 years ago           | 
        
        
          | 
             
using namespace sophya enleve de machdefs.h, nouveau sopnamsp.h  cmv 10/09/2004 
 
           | 
        
        
          | 
            File size:
            782 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include "sopnamsp.h"
 | 
|---|
| 2 | #include "pexceptions.h"
 | 
|---|
| 3 | #include <iostream>
 | 
|---|
| 4 | #include <stdio.h>
 | 
|---|
| 5 | 
 | 
|---|
| 6 | void PFailHandler(void); 
 | 
|---|
| 7 | 
 | 
|---|
| 8 | // egcs ne semble pas connaitre set_new_handler (Reza 26/04/99)
 | 
|---|
| 9 | // ca ne passe plus avec SGI-CC -LANG:std $CHECK$ Reza 14/02/2003
 | 
|---|
| 10 | #if defined( __GNUG__ ) || defined(__SGICC__)
 | 
|---|
| 11 | void PFailHandler(void) {}
 | 
|---|
| 12 | void InitFailNewHandler() {}
 | 
|---|
| 13 | #else
 | 
|---|
| 14 | 
 | 
|---|
| 15 | void PFailHandler(void)
 | 
|---|
| 16 | {
 | 
|---|
| 17 |   set_new_handler(NULL);
 | 
|---|
| 18 |   cerr << "Allocation exception -- out of memory" << endl;
 | 
|---|
| 19 |   throw(AllocationError("new"));
 | 
|---|
| 20 | }
 | 
|---|
| 21 | 
 | 
|---|
| 22 | void InitFailNewHandler()
 | 
|---|
| 23 | {
 | 
|---|
| 24 |    set_new_handler(PFailHandler);
 | 
|---|
| 25 | }
 | 
|---|
| 26 | #endif
 | 
|---|
| 27 | 
 | 
|---|
| 28 | string SOPHYA::BuildLongExceptionMessage(const char * s, const char *file, int line)
 | 
|---|
| 29 | {
 | 
|---|
| 30 |   char buff[32];
 | 
|---|
| 31 |   sprintf(buff," Line=%d", line);
 | 
|---|
| 32 |   string rs=s;
 | 
|---|
| 33 |   rs += " File="; rs += file; rs += buff;
 | 
|---|
| 34 |   return(rs);
 | 
|---|
| 35 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.