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 | * |
| 5 | * This file is distributed under the University of Illinois Open Source |
| 6 | * License. See LICENSE.TXT for details. |
| 7 | * |
| 8 | * ===----------------------------------------------------------------------=== |
| 9 | */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | |
| 13 | #include <stdio.h> |
| 14 | #include <stdlib.h> |
| 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 | */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 25 | __attribute__((visibility("hidden"))) |
| 26 | void __eprintf(const char* format, const char* assertion_expression, |
| 27 | const char* line, const char* file) |
| 28 | { |
| 29 | fprintf(stderr, format, assertion_expression, line, file); |
| 30 | fflush(stderr); |
| 31 | abort(); |
| 32 | } |