Home | History | Annotate | Line # | Download | only in builtins
      1      1.1  joerg /* ===---------- eprintf.c - Implements __eprintf --------------------------===
      2      1.1  joerg  *
      3      1.1  joerg  *                     The LLVM Compiler Infrastructure
      4      1.1  joerg  *
      5      1.1  joerg  * This file is dual licensed under the MIT and the University of Illinois Open
      6      1.1  joerg  * Source Licenses. See LICENSE.TXT for details.
      7      1.1  joerg  *
      8      1.1  joerg  * ===----------------------------------------------------------------------===
      9      1.1  joerg  */
     10      1.1  joerg 
     11      1.1  joerg 
     12      1.1  joerg 
     13      1.1  joerg #include "int_lib.h"
     14      1.1  joerg #include <stdio.h>
     15      1.1  joerg 
     16      1.1  joerg 
     17      1.1  joerg /*
     18      1.1  joerg  * __eprintf() was used in an old version of <assert.h>.
     19      1.1  joerg  * It can eventually go away, but it is needed when linking
     20      1.1  joerg  * .o files built with the old <assert.h>.
     21      1.1  joerg  *
     22      1.1  joerg  * It should never be exported from a dylib, so it is marked
     23      1.1  joerg  * visibility hidden.
     24      1.1  joerg  */
     25      1.1  joerg #ifndef _WIN32
     26      1.1  joerg __attribute__((visibility("hidden")))
     27      1.1  joerg #endif
     28  1.1.1.2  joerg COMPILER_RT_ABI void
     29  1.1.1.2  joerg __eprintf(const char* format, const char* assertion_expression,
     30  1.1.1.2  joerg 	  const char* line, const char* file)
     31      1.1  joerg {
     32      1.1  joerg 	fprintf(stderr, format, assertion_expression, line, file);
     33      1.1  joerg 	fflush(stderr);
     34      1.1  joerg 	compilerrt_abort();
     35      1.1  joerg }
     36