blob: 786fe6aaa672aab9e71cc153bc0dbbe9145ddc3b [file] [log] [blame]
Edward O'Callaghan2bf62722009-08-05 04:02:56 +00001/* ===---------- eprintf.c - Implements __eprintf --------------------------===
2 *
3 * The LLVM Compiler Infrastructure
4 *
5 * This file is distributed under the University of Illinois Open Source
6 * License. See LICENSE.TXT for details.
7 *
8 * ===----------------------------------------------------------------------===
9 */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000010
11
12
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000013#include "int_lib.h"
Daniel Dunbarb3a69012009-06-26 16:47:03 +000014#include <stdio.h>
15#include <stdlib.h>
16
17
Edward O'Callaghan2bf62722009-08-05 04:02:56 +000018/*
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 */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000026__attribute__((visibility("hidden")))
27void __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);
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000032 compilerrt_abort();
Daniel Dunbarb3a69012009-06-26 16:47:03 +000033}