source: git/kernel/dError.c @ f2b6f0b

spielwiese
Last change on this file since f2b6f0b was b1dfaf, checked in by Frank Seelisch <seelisch@…>, 14 years ago
patch from Kai (checked for problems under Windows OS: no problems) git-svn-id: file:///usr/local/Singular/svn/trunk@13210 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    dError.c
6 *  Purpose: implementation for debug error handling
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 9/00
9 *  Version: $Id$
10 *******************************************************************/
11#ifndef DERROR_C
12#define DERROR_C
13#include <stdarg.h>
14#include <stdio.h>
15#include <kernel/mod2.h>
16#include <Singular/distrib.h>
17#ifdef HAVE_CONFIG_H
18#include <omalloc/omalloc.h>
19#endif
20
21#ifdef __cplusplus
22extern "C" 
23{
24#endif
25
26int dReportError(const char* fmt, ...)
27{
28  va_list ap;
29  va_start(ap, fmt);
30#ifndef MAKE_DISTRIBUTION
31  fprintf(stderr, "\n// ***dError: ");
32  vfprintf(stderr, fmt, ap);
33#if 0
34    if !defined(OM_NDEBUG) && defined(HAVE_CONFIG_H)
35#endif
36#if  defined(HAVE_CONFIG_H)
37  fprintf(stderr, " occured at: \n");
38  omPrintCurrentBackTraceMax(stderr, 8);
39#endif
40  dErrorBreak();
41#else
42  fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR.");
43  fprintf(stderr, "// !!! Please, email the following output to singular@mathematik.uni-kl.de");
44  fprintf(stderr, "// !!! Singular Version: " S_UNAME S_VERSION1 "\n");
45  vfprintf(stderr, fmt, ap);
46#endif
47  return 0;
48}
49
50
51#ifndef MAKE_DISTRIBUTION
52// dummy procedure for setting a breakpoint
53// within the debugger
54void dErrorBreak()
55{}
56#endif
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif
63 
64
65
66 
67 
68 
Note: See TracBrowser for help on using the repository browser.