Mercurial > code
comparison port/C/asprintf.h @ 548:f48bb09bccc7
Misc: huge cleanup, switch to spaces
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 15 Jun 2016 13:13:26 +0200 |
parents | dc1b5143c5e3 |
children | 266f32919d0a |
comparison
equal
deleted
inserted
replaced
547:ecf5fb9319da | 548:f48bb09bccc7 |
---|---|
1 /* | 1 /* |
2 * asprintf.h -- basic port of asprintf / vsprintf functions | 2 * asprintf.h -- basic port of asprintf / vsprintf functions |
3 * | 3 * |
4 * Copyright (c) 2011, 2012 David Demelier <markand@malikania.fr> | 4 * Copyright (c) 2011-2016 David Demelier <markand@malikania.fr> |
5 * | 5 * |
6 * Permission to use, copy, modify, and/or distribute this software for any | 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 | 7 * purpose with or without fee is hereby granted, provided that the above |
8 * copyright notice and this permission notice appear in all copies. | 8 * copyright notice and this permission notice appear in all copies. |
9 * | 9 * |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 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 | 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 */ | 17 */ |
18 | 18 |
19 #ifndef ASPRINTF_H | |
20 #define ASPRINTF_H | |
21 | |
19 #include <stdarg.h> | 22 #include <stdarg.h> |
20 | 23 |
21 #ifdef __cplusplus | 24 #ifdef __cplusplus |
22 extern "C" { | 25 extern "C" { |
23 #endif | 26 #endif |
24 | 27 |
25 #ifdef __GNUC__ | 28 #ifdef __GNUC__ |
26 # define _asp_at_printf(i1, i2) __attribute__ ((format (printf, i1, i2))) | 29 # define ASPRINTF_FMT(i1, i2) __attribute__ ((format (printf, i1, i2))) |
27 #else | 30 #else |
28 # define _asp_at_printf(i1, i2) | 31 # define ASPRINTF_FMT(i1, i2) |
29 #endif | 32 #endif |
30 | 33 |
31 int asprintf(char **, const char *, ...) _asp_at_printf(2, 3); | 34 int |
32 int vasprintf(char **, const char *, va_list); | 35 asprintf(char **, const char *, ...) ASPRINTF_FMT(2, 3); |
36 | |
37 int | |
38 vasprintf(char **, const char *, va_list); | |
33 | 39 |
34 #ifdef __cplusplus | 40 #ifdef __cplusplus |
35 } | 41 } |
36 #endif | 42 #endif |
43 | |
44 #endif /* !ASPRINTF_H */ |