summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger2012-03-07 16:00:02 (GMT)
committerMike Frysinger2012-06-23 21:23:10 (GMT)
commit2995c5954980f84b0e4a5501dbdde92ec57293ca (patch)
treee41f44430a8dac74311e595358ed14102691052b
parent10d063518923c1452b6ab75a52f71ed2ece4e859 (diff)
libsandbox: create more defines for gcc attributes
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--libsandbox/libsandbox.h4
-rw-r--r--libsbutil/sbutil.h8
-rw-r--r--localdecls.h2
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