2009-08-05 12:02:56 +08:00
|
|
|
/* ===---------- eprintf.c - Implements __eprintf --------------------------===
|
|
|
|
*
|
|
|
|
* The LLVM Compiler Infrastructure
|
|
|
|
*
|
2010-11-17 06:13:33 +08:00
|
|
|
* This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
* Source Licenses. See LICENSE.TXT for details.
|
2009-08-05 12:02:56 +08:00
|
|
|
*
|
|
|
|
* ===----------------------------------------------------------------------===
|
|
|
|
*/
|
2009-06-27 00:47:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-01 01:00:45 +08:00
|
|
|
#include "int_lib.h"
|
2009-06-27 00:47:03 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
2009-08-05 12:02:56 +08:00
|
|
|
/*
|
|
|
|
* __eprintf() was used in an old version of <assert.h>.
|
|
|
|
* It can eventually go away, but it is needed when linking
|
|
|
|
* .o files built with the old <assert.h>.
|
|
|
|
*
|
|
|
|
* It should never be exported from a dylib, so it is marked
|
|
|
|
* visibility hidden.
|
|
|
|
*/
|
2013-07-17 06:37:55 +08:00
|
|
|
#ifndef _WIN32
|
2009-06-27 00:47:03 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2013-07-17 06:37:55 +08:00
|
|
|
#endif
|
2014-03-01 23:30:50 +08:00
|
|
|
COMPILER_RT_ABI void
|
|
|
|
__eprintf(const char* format, const char* assertion_expression,
|
|
|
|
const char* line, const char* file)
|
2009-06-27 00:47:03 +08:00
|
|
|
{
|
|
|
|
fprintf(stderr, format, assertion_expression, line, file);
|
|
|
|
fflush(stderr);
|
2010-04-01 01:00:45 +08:00
|
|
|
compilerrt_abort();
|
2009-06-27 00:47:03 +08:00
|
|
|
}
|