xref: /openbsd-src/gnu/llvm/compiler-rt/lib/builtins/eprintf.c (revision 810390e339a5425391477d5d41c78d7cab2424ac)
13cab2bb3Spatrick //===---------- eprintf.c - Implements __eprintf --------------------------===//
23cab2bb3Spatrick //
33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information.
53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63cab2bb3Spatrick //
73cab2bb3Spatrick //===----------------------------------------------------------------------===//
83cab2bb3Spatrick 
93cab2bb3Spatrick #include "int_lib.h"
103cab2bb3Spatrick #include <stdio.h>
113cab2bb3Spatrick 
123cab2bb3Spatrick // __eprintf() was used in an old version of <assert.h>.
133cab2bb3Spatrick // It can eventually go away, but it is needed when linking
143cab2bb3Spatrick // .o files built with the old <assert.h>.
153cab2bb3Spatrick //
163cab2bb3Spatrick // It should never be exported from a dylib, so it is marked
173cab2bb3Spatrick // visibility hidden.
18*810390e3Srobert #ifndef DONT_DEFINE_EPRINTF
193cab2bb3Spatrick #ifndef _WIN32
203cab2bb3Spatrick __attribute__((visibility("hidden")))
213cab2bb3Spatrick #endif
223cab2bb3Spatrick COMPILER_RT_ABI void
__eprintf(const char * format,const char * assertion_expression,const char * line,const char * file)233cab2bb3Spatrick __eprintf(const char *format, const char *assertion_expression,
243cab2bb3Spatrick           const char *line, const char *file) {
253cab2bb3Spatrick   fprintf(stderr, format, assertion_expression, line, file);
263cab2bb3Spatrick   fflush(stderr);
273cab2bb3Spatrick   compilerrt_abort();
283cab2bb3Spatrick }
29*810390e3Srobert #endif
30