Mercurial > code
comparison c/err/err.h @ 621:ca5912ad2909
Misc: massive refactoring, closes #717
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 20 Oct 2017 12:36:51 +0200 |
parents | port/C/err.h@266f32919d0a |
children | b327391f6a62 |
comparison
equal
deleted
inserted
replaced
620:e24fc739ec74 | 621:ca5912ad2909 |
---|---|
1 /* | |
2 * err.h -- formtted error messages (portable version) | |
3 * | |
4 * Copyright (c) 2011-2017 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef ERR_H | |
20 #define ERR_H | |
21 | |
22 #include <stdarg.h> | |
23 | |
24 #ifdef __cplusplus | |
25 extern "C" { | |
26 #endif | |
27 | |
28 #if defined(__GNUC__) | |
29 # define ERR_NORETURN __attribute__ ((noreturn)) | |
30 #elif defined(_MSC_VER) | |
31 # define ERR_NORETURN __declspec(noreturn) | |
32 #endif | |
33 | |
34 void | |
35 err(int, const char *, ...) ERR_NORETURN; | |
36 | |
37 void | |
38 verr(int, const char *, va_list) ERR_NORETURN; | |
39 | |
40 void | |
41 errx(int, const char *, ...) ERR_NORETURN; | |
42 | |
43 void | |
44 verrx(int, const char *, va_list) ERR_NORETURN; | |
45 | |
46 void | |
47 warn(const char *, ...); | |
48 | |
49 void | |
50 vwarn(const char *, va_list); | |
51 | |
52 void | |
53 warnx(const char *, ...); | |
54 | |
55 void | |
56 vwarnx(const char *, va_list); | |
57 | |
58 #ifdef __cplusplus | |
59 } | |
60 #endif | |
61 | |
62 #endif /* ERR_H */ |