xref: /minix3/sys/external/bsd/compiler_rt/dist/lib/builtins/eprintf.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /* ===---------- eprintf.c - Implements __eprintf --------------------------===
2*0a6a1f1dSLionel Sambuc  *
3*0a6a1f1dSLionel Sambuc  *                     The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc  *
5*0a6a1f1dSLionel Sambuc  * This file is dual licensed under the MIT and the University of Illinois Open
6*0a6a1f1dSLionel Sambuc  * Source Licenses. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc  *
8*0a6a1f1dSLionel Sambuc  * ===----------------------------------------------------------------------===
9*0a6a1f1dSLionel Sambuc  */
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc #include "int_lib.h"
14*0a6a1f1dSLionel Sambuc #include <stdio.h>
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc /*
18*0a6a1f1dSLionel Sambuc  * __eprintf() was used in an old version of <assert.h>.
19*0a6a1f1dSLionel Sambuc  * It can eventually go away, but it is needed when linking
20*0a6a1f1dSLionel Sambuc  * .o files built with the old <assert.h>.
21*0a6a1f1dSLionel Sambuc  *
22*0a6a1f1dSLionel Sambuc  * It should never be exported from a dylib, so it is marked
23*0a6a1f1dSLionel Sambuc  * visibility hidden.
24*0a6a1f1dSLionel Sambuc  */
25*0a6a1f1dSLionel Sambuc #ifndef _WIN32
26*0a6a1f1dSLionel Sambuc __attribute__((visibility("hidden")))
27*0a6a1f1dSLionel Sambuc #endif
28*0a6a1f1dSLionel Sambuc COMPILER_RT_ABI void
__eprintf(const char * format,const char * assertion_expression,const char * line,const char * file)29*0a6a1f1dSLionel Sambuc __eprintf(const char* format, const char* assertion_expression,
30*0a6a1f1dSLionel Sambuc 	  const char* line, const char* file)
31*0a6a1f1dSLionel Sambuc {
32*0a6a1f1dSLionel Sambuc 	fprintf(stderr, format, assertion_expression, line, file);
33*0a6a1f1dSLionel Sambuc 	fflush(stderr);
34*0a6a1f1dSLionel Sambuc 	compilerrt_abort();
35*0a6a1f1dSLionel Sambuc }
36