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

Last change on this file since 1959 was 1959, checked in by ansari, 24 years ago

correction flag #ifdef #end pour compil avec gcc ds pexceptions.cc - Reza 29/3/2002

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