Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: /, libsbutil/, libsandbox/
Date: Sat, 23 Jun 2012 21:25:36
Message-Id: 1340486590.2995c5954980f84b0e4a5501dbdde92ec57293ca.vapier@gentoo
1 commit: 2995c5954980f84b0e4a5501dbdde92ec57293ca
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 7 16:00:02 2012 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 23 21:23:10 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=2995c595
7
8 libsandbox: create more defines for gcc attributes
9
10 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
11
12 ---
13 libsandbox/libsandbox.h | 4 ++--
14 libsbutil/sbutil.h | 8 ++++----
15 localdecls.h | 2 ++
16 3 files changed, 8 insertions(+), 6 deletions(-)
17
18 diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h
19 index 0324b5b..3177253 100644
20 --- a/libsandbox/libsandbox.h
21 +++ b/libsandbox/libsandbox.h
22 @@ -63,9 +63,9 @@ extern void sb_unlock(void);
23
24 void trace_main(const char *filename, char *const argv[]);
25
26 -__attribute__((__format__(__printf__, 1, 2))) void sb_eqawarn(const char *format, ...);
27 +__printf(1, 2) void sb_eqawarn(const char *format, ...);
28 void sb_dump_backtrace(void);
29 -__attribute__((noreturn)) void sb_abort(void);
30 +__noreturn void sb_abort(void);
31
32 /* glibc modified realpath() function */
33 char *erealpath(const char *, char *);
34
35 diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
36 index ad9ce25..f45402e 100644
37 --- a/libsbutil/sbutil.h
38 +++ b/libsbutil/sbutil.h
39 @@ -96,10 +96,10 @@ size_t sb_write(int fd, const void *buf, size_t count);
40 int sb_close(int fd);
41
42 /* Reliable output */
43 -__attribute__((__format__(__printf__, 1, 2))) void sb_printf(const char *format, ...);
44 -__attribute__((__format__(__printf__, 2, 3))) void sb_fdprintf(int fd, const char *format, ...);
45 -__attribute__((__format__(__printf__, 2, 0))) void sb_vfdprintf(int fd, const char *format, va_list args);
46 -__attribute__((__format__(__printf__, 3, 4))) void sb_efunc(const char *color, const char *hilight, const char *format, ...);
47 +__printf(1, 2) void sb_printf(const char *format, ...);
48 +__printf(2, 3) void sb_fdprintf(int fd, const char *format, ...);
49 +__printf(2, 0) void sb_vfdprintf(int fd, const char *format, va_list args);
50 +__printf(3, 4) void sb_efunc(const char *color, const char *hilight, const char *format, ...);
51 #define sb_fprintf(fp, ...) sb_fdprintf(fileno(fp), __VA_ARGS__)
52 #define sb_vfprintf(fp, ...) sb_vfdprintf(fileno(fp), __VA_ARGS__)
53
54
55 diff --git a/localdecls.h b/localdecls.h
56 index 674e848..eef7295 100644
57 --- a/localdecls.h
58 +++ b/localdecls.h
59 @@ -119,5 +119,7 @@ typedef struct user_regs_struct trace_regs;
60
61 #define likely(x) __builtin_expect(!!(x), 1)
62 #define unlikely(x) __builtin_expect(!!(x), 0)
63 +#define __noreturn __attribute__((noreturn))
64 +#define __printf(x, y) __attribute__((__format__(__printf__, x, y)))
65
66 #endif