]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/compiler-rt/lib/eprintf.c
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / contrib / compiler-rt / lib / eprintf.c
1 /* ===---------- eprintf.c - Implements __eprintf --------------------------===
2  *
3  *                     The LLVM Compiler Infrastructure
4  *
5  * This file is dual licensed under the MIT and the University of Illinois Open
6  * Source Licenses. See LICENSE.TXT for details.
7  *
8  * ===----------------------------------------------------------------------===
9  */
10
11
12
13 #include "int_lib.h"
14 #include <stdio.h>
15 #include <stdlib.h>
16
17
18 /*
19  * __eprintf() was used in an old version of <assert.h>.
20  * It can eventually go away, but it is needed when linking
21  * .o files built with the old <assert.h>.
22  *
23  * It should never be exported from a dylib, so it is marked
24  * visibility hidden.
25  */
26 __attribute__((visibility("hidden")))
27 void __eprintf(const char* format, const char* assertion_expression,
28                                 const char* line, const char* file)
29 {
30         fprintf(stderr, format, assertion_expression, line, file);
31         fflush(stderr);
32         compilerrt_abort();
33 }