source: Sophya/trunk/SophyaLib/BaseTools/pexceptions.cc@ 1960

Last change on this file since 1960 was 1960, checked in by cmv, 23 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
5void PFailHandler(void);
6
7// egcs ne semble pas connaitre set_new_handler (Reza 26/04/99)
8#ifdef __GNUG__
9void PFailHandler(void) {}
10void InitFailNewHandler() {}
11#else
12
13void PFailHandler(void)
14{
15 set_new_handler(NULL);
16 cerr << "Allocation exception -- out of memory" << endl;
17 throw(AllocationError("new"));
18}
19
20void InitFailNewHandler()
21{
22 set_new_handler(PFailHandler);
23}
24#endif
25
26string 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.