Edward O'Callaghan | 2bf6272 | 2009-08-05 04:02:56 +0000 | [diff] [blame] | 1 | /* ===---------- eprintf.c - Implements __eprintf --------------------------=== |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
Howard Hinnant | 9ad441f | 2010-11-16 22:13:33 +0000 | [diff] [blame] | 5 | * This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | * Source Licenses. See LICENSE.TXT for details. |
Edward O'Callaghan | 2bf6272 | 2009-08-05 04:02:56 +0000 | [diff] [blame] | 7 | * |
| 8 | * ===----------------------------------------------------------------------=== |
| 9 | */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | |
Daniel Dunbar | 48f46ac | 2010-03-31 17:00:45 +0000 | [diff] [blame] | 13 | #include "int_lib.h" |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 14 | #include <stdio.h> |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 15 | |
| 16 | |
Edward O'Callaghan | 2bf6272 | 2009-08-05 04:02:56 +0000 | [diff] [blame] | 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 | */ |
Anton Korobeynikov | 6092c21 | 2013-07-16 22:37:55 +0000 | [diff] [blame] | 25 | #ifndef _WIN32 |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 26 | __attribute__((visibility("hidden"))) |
Anton Korobeynikov | 6092c21 | 2013-07-16 22:37:55 +0000 | [diff] [blame] | 27 | #endif |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 28 | void __eprintf(const char* format, const char* assertion_expression, |
| 29 | const char* line, const char* file) |
| 30 | { |
| 31 | fprintf(stderr, format, assertion_expression, line, file); |
| 32 | fflush(stderr); |
Daniel Dunbar | 48f46ac | 2010-03-31 17:00:45 +0000 | [diff] [blame] | 33 | compilerrt_abort(); |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 34 | } |