| 
            Last change
 on this file since 2027 was             1960, checked in by cmv, 24 years ago           | 
        
        
          | 
             
include<stdio.h> pour spribtf  cmv 31/3/02 
 
           | 
        
        
          | 
            File size:
            666 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include "pexceptions.h"
 | 
|---|
| 2 | #include <iostream.h>
 | 
|---|
| 3 | #include <stdio.h>
 | 
|---|
| 4 | 
 | 
|---|
| 5 | void PFailHandler(void); 
 | 
|---|
| 6 | 
 | 
|---|
| 7 | // egcs ne semble pas connaitre set_new_handler (Reza 26/04/99)
 | 
|---|
| 8 | #ifdef __GNUG__
 | 
|---|
| 9 | void PFailHandler(void) {}
 | 
|---|
| 10 | void InitFailNewHandler() {}
 | 
|---|
| 11 | #else
 | 
|---|
| 12 | 
 | 
|---|
| 13 | void PFailHandler(void)
 | 
|---|
| 14 | {
 | 
|---|
| 15 |   set_new_handler(NULL);
 | 
|---|
| 16 |   cerr << "Allocation exception -- out of memory" << endl;
 | 
|---|
| 17 |   throw(AllocationError("new"));
 | 
|---|
| 18 | }
 | 
|---|
| 19 | 
 | 
|---|
| 20 | void InitFailNewHandler()
 | 
|---|
| 21 | {
 | 
|---|
| 22 |    set_new_handler(PFailHandler);
 | 
|---|
| 23 | }
 | 
|---|
| 24 | #endif
 | 
|---|
| 25 | 
 | 
|---|
| 26 | string SOPHYA::BuildLongExceptionMessage(const char * s, const char *file, int line)
 | 
|---|
| 27 | {
 | 
|---|
| 28 |   char buff[32];
 | 
|---|
| 29 |   sprintf(buff," Line=%d", line);
 | 
|---|
| 30 |   string rs=s;
 | 
|---|
| 31 |   rs += " File="; rs += file; rs += buff;
 | 
|---|
| 32 |   return(rs);
 | 
|---|
| 33 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.