File: vcl_cassert.cxx

package info (click to toggle)
insighttoolkit 3.6.0-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 94,956 kB
  • ctags: 74,981
  • sloc: cpp: 355,621; ansic: 195,070; fortran: 28,713; python: 3,802; tcl: 1,996; sh: 1,175; java: 583; makefile: 415; csh: 184; perl: 175
file content (29 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @author fsm
#include <vcl_cstdio.h>
#include <vcl_cstdlib.h>

void vcl_cassert_failure(char const *FILE, int LINE, char const *expr)
{
  vcl_fprintf(stderr, "%s:%d assertion failure \'%s\'\n",
              FILE, LINE, expr);
  vcl_fflush(stderr);
  vcl_abort();
}

#ifndef __GNUC__
// fsm: This is a silly hack to enable us to link code compiled
// with SunPro against a library (such as libMesaGL) compiled with gcc.
// The gcc assert macro uses a function call __eprintf() which is defined
// in gcc/libgcc2.c in the gcc sources.
//
// Note that this is fixing a problem with *gcc*, not the SunPro or
// KAI compilers.
extern "C" void
__eprintf(char const *string, char const *expression,
          unsigned int line, char const *filename)
{
  vcl_fprintf(stderr, string, expression, line, filename);
  vcl_fflush(stderr);
  vcl_abort();
}
#endif