ReactOS 0.4.15-dev-7953-g1f49173
error.c
Go to the documentation of this file.
1/* @(#)error.c 1.18 15/08/01 Copyright 1985, 1989, 1995-2015 J. Schilling */
2/*
3 * fprintf() on standard error stdio stream
4 *
5 * Copyright (c) 1985, 1989, 1995-2015 J. Schilling
6 */
7/*
8 * The contents of this file are subject to the terms of the
9 * Common Development and Distribution License, Version 1.0 only
10 * (the "License"). You may not use this file except in compliance
11 * with the License.
12 *
13 * See the file CDDL.Schily.txt in this distribution for details.
14 * A copy of the CDDL is also available via the Internet at
15 * http://www.opensource.org/licenses/cddl1.txt
16 *
17 * When distributing Covered Code, include this CDDL HEADER in each
18 * file and include the License file CDDL.Schily.txt from this distribution.
19 */
20
21#include <schily/mconfig.h>
22#include <schily/stdio.h>
23#include <schily/standard.h>
24#include <schily/varargs.h>
25#include <schily/schily.h>
26
27#undef error
28
29#ifndef NO_WEAK_SYMBOLS
30/*
31 * The Cygwin compile environment incorrectly implements #pragma weak.
32 * The weak symbols are only defined as local symbols making it impossible
33 * to use them from outside the scope of this source file.
34 * A platform that allows linking with global symbols has HAVE_LINK_WEAK
35 * defined.
36 */
37#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK)
38#pragma weak error = js_error
39#else
40/* VARARGS1 */
41#ifdef PROTOTYPES
42EXPORT int
43error(const char *fmt, ...)
44#else
45EXPORT int
46error(fmt, va_alist)
47 char *fmt;
48 va_dcl
49#endif
50{
52 int ret;
53
54#ifdef PROTOTYPES
56#else
58#endif
59 ret = js_fprintf(stderr, "%r", fmt, args);
60 va_end(args);
61 return (ret);
62}
63#endif
64#endif /* NO_WEAK_SYMBOLS */
65
66/* VARARGS1 */
67#ifdef PROTOTYPES
68EXPORT int
69js_error(const char *fmt, ...)
70#else
71EXPORT int
72js_error(fmt, va_alist)
73 char *fmt;
74 va_dcl
75#endif
76{
78 int ret;
79
80#ifdef PROTOTYPES
82#else
84#endif
85 ret = js_fprintf(stderr, "%r", fmt, args);
86 va_end(args);
87 return (ret);
88}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define stderr
Definition: stdio.h:100
EXPORT int js_fprintf(FILE *file, char *form, va_alist)
Definition: jsprintf.c:71
#define error(str)
Definition: mkdosfs.c:1605
EXPORT int js_error(char *fmt, va_alist)
Definition: error.c:72
#define args
Definition: format.c:66
Definition: match.c:390
Definition: dsound.c:943
int ret