Last change
on this file since 2110 was 1960, checked in by cmv, 23 years ago |
include<stdio.h> pour spribtf cmv 31/3/02
|
File size:
666 bytes
|
Rev | Line | |
---|
[242] | 1 | #include "pexceptions.h"
|
---|
| 2 | #include <iostream.h>
|
---|
[1960] | 3 | #include <stdio.h>
|
---|
[242] | 4 |
|
---|
| 5 | void PFailHandler(void);
|
---|
| 6 |
|
---|
[269] | 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 |
|
---|
[242] | 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 | }
|
---|
[1959] | 24 | #endif
|
---|
[242] | 25 |
|
---|
[1958] | 26 | string SOPHYA::BuildLongExceptionMessage(const char * s, const char *file, int line)
|
---|
[773] | 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.