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