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

Last change on this file since 2339 was 2339, checked in by ansari, 23 years ago

Compli avec SGI-CC -LANG:std et remplacement template <> pour SGI-CC par DECL_TEMP_SPEC - Reza 10/03/2003

File size: 760 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// ca ne passe plus avec SGI-CC -LANG:std $CHECK$ Reza 14/02/2003
9#if defined( __GNUG__ ) || defined(__SGICC__)
10void PFailHandler(void) {}
11void InitFailNewHandler() {}
12#else
13
14void PFailHandler(void)
15{
16 set_new_handler(NULL);
17 cerr << "Allocation exception -- out of memory" << endl;
18 throw(AllocationError("new"));
19}
20
21void InitFailNewHandler()
22{
23 set_new_handler(PFailHandler);
24}
25#endif
26
27string SOPHYA::BuildLongExceptionMessage(const char * s, const char *file, int line)
28{
29 char buff[32];
30 sprintf(buff," Line=%d", line);
31 string rs=s;
32 rs += " File="; rs += file; rs += buff;
33 return(rs);
34}
Note: See TracBrowser for help on using the repository browser.