]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/lib/builtins/eprintf.c
New upstream version 1.19.0+dfsg3
[rustc.git] / src / compiler-rt / lib / builtins / eprintf.c
CommitLineData
1a4d82fc
JJ
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
16
17/*
18 * __eprintf() was used in an old version of <assert.h>.
19 * It can eventually go away, but it is needed when linking
20 * .o files built with the old <assert.h>.
21 *
22 * It should never be exported from a dylib, so it is marked
23 * visibility hidden.
24 */
25#ifndef _WIN32
26__attribute__((visibility("hidden")))
27#endif
28COMPILER_RT_ABI void
29__eprintf(const char* format, const char* assertion_expression,
30 const char* line, const char* file)
31{
32 fprintf(stderr, format, assertion_expression, line, file);
33 fflush(stderr);
34 compilerrt_abort();
35}