public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sandbox:master commit in: /, libsbutil/, libsandbox/
@ 2012-06-23 21:25 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2012-06-23 21:25 UTC (permalink / raw
  To: gentoo-commits

commit:     2995c5954980f84b0e4a5501dbdde92ec57293ca
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  7 16:00:02 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 21:23:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=2995c595

libsandbox: create more defines for gcc attributes

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 libsandbox/libsandbox.h |    4 ++--
 libsbutil/sbutil.h      |    8 ++++----
 localdecls.h            |    2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h
index 0324b5b..3177253 100644
--- a/libsandbox/libsandbox.h
+++ b/libsandbox/libsandbox.h
@@ -63,9 +63,9 @@ extern void sb_unlock(void);
 
 void trace_main(const char *filename, char *const argv[]);
 
-__attribute__((__format__(__printf__, 1, 2))) void sb_eqawarn(const char *format, ...);
+__printf(1, 2) void sb_eqawarn(const char *format, ...);
 void sb_dump_backtrace(void);
-__attribute__((noreturn)) void sb_abort(void);
+__noreturn void sb_abort(void);
 
 /* glibc modified realpath() function */
 char *erealpath(const char *, char *);

diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
index ad9ce25..f45402e 100644
--- a/libsbutil/sbutil.h
+++ b/libsbutil/sbutil.h
@@ -96,10 +96,10 @@ size_t sb_write(int fd, const void *buf, size_t count);
 int sb_close(int fd);
 
 /* Reliable output */
-__attribute__((__format__(__printf__, 1, 2))) void sb_printf(const char *format, ...);
-__attribute__((__format__(__printf__, 2, 3))) void sb_fdprintf(int fd, const char *format, ...);
-__attribute__((__format__(__printf__, 2, 0))) void sb_vfdprintf(int fd, const char *format, va_list args);
-__attribute__((__format__(__printf__, 3, 4))) void sb_efunc(const char *color, const char *hilight, const char *format, ...);
+__printf(1, 2) void sb_printf(const char *format, ...);
+__printf(2, 3) void sb_fdprintf(int fd, const char *format, ...);
+__printf(2, 0) void sb_vfdprintf(int fd, const char *format, va_list args);
+__printf(3, 4) void sb_efunc(const char *color, const char *hilight, const char *format, ...);
 #define sb_fprintf(fp, ...) sb_fdprintf(fileno(fp), __VA_ARGS__)
 #define sb_vfprintf(fp, ...) sb_vfdprintf(fileno(fp), __VA_ARGS__)
 

diff --git a/localdecls.h b/localdecls.h
index 674e848..eef7295 100644
--- a/localdecls.h
+++ b/localdecls.h
@@ -119,5 +119,7 @@ typedef struct user_regs_struct trace_regs;
 
 #define likely(x)   __builtin_expect(!!(x), 1)
 #define unlikely(x) __builtin_expect(!!(x), 0)
+#define __noreturn __attribute__((noreturn))
+#define __printf(x, y) __attribute__((__format__(__printf__, x, y)))
 
 #endif



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-23 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-23 21:25 [gentoo-commits] proj/sandbox:master commit in: /, libsbutil/, libsandbox/ Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox