fail.c revision 1.1 1 1.1 ross
2 1.1 ross /*
3 1.1 ross ===============================================================================
4 1.1 ross
5 1.1 ross This C source file is part of TestFloat, Release 2a, a package of programs
6 1.1 ross for testing the correctness of floating-point arithmetic complying to the
7 1.1 ross IEC/IEEE Standard for Floating-Point.
8 1.1 ross
9 1.1 ross Written by John R. Hauser. More information is available through the Web
10 1.1 ross page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
11 1.1 ross
12 1.1 ross THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
13 1.1 ross has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
14 1.1 ross TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
15 1.1 ross PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
16 1.1 ross AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
17 1.1 ross
18 1.1 ross Derivative works are acceptable, even for commercial purposes, so long as
19 1.1 ross (1) they include prominent notice that the work is derivative, and (2) they
20 1.1 ross include prominent notice akin to these four paragraphs for those parts of
21 1.1 ross this code that are retained.
22 1.1 ross
23 1.1 ross ===============================================================================
24 1.1 ross */
25 1.1 ross
26 1.1 ross #include <stdlib.h>
27 1.1 ross #include <stdarg.h>
28 1.1 ross #include <stdio.h>
29 1.1 ross #include "milieu.h"
30 1.1 ross #include "fail.h"
31 1.1 ross
32 1.1 ross char *fail_programName = "";
33 1.1 ross
34 1.1 ross void fail( const char *message, ... )
35 1.1 ross {
36 1.1 ross va_list varArgs;
37 1.1 ross
38 1.1 ross fprintf( stderr, "%s: ", fail_programName );
39 1.1 ross va_start( varArgs, message );
40 1.1 ross vfprintf( stderr, message, varArgs );
41 1.1 ross va_end( varArgs );
42 1.1 ross fputs( ".\n", stderr );
43 1.1 ross exit( EXIT_FAILURE );
44 1.1 ross
45 1.1 ross }
46 1.1 ross
47