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

Last change on this file since 2322 was 2322, checked in by cmv, 23 years ago
  • passage xxstream.h en xxstream
  • compile avec gcc_3.2, gcc_2.96 et cxx En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)

rz+cmv 11/2/2003

File size: 664 bytes
Line 
1#include "pexceptions.h"
2#include <iostream>
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.