projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fall back to VERSION file if .git is not present
[tinc]
/
src
/
xalloc.h
diff --git
a/src/xalloc.h
b/src/xalloc.h
index
33f30d0
..
96b9592
100644
(file)
--- a/
src/xalloc.h
+++ b/
src/xalloc.h
@@
-23,7
+23,7
@@
#include "system.h"
#include "system.h"
-static inline void *xmalloc(size_t n)
__attribute__((__malloc__))
;
+static inline void *xmalloc(size_t n)
ATTR_MALLOC
;
static inline void *xmalloc(size_t n) {
void *p = malloc(n);
static inline void *xmalloc(size_t n) {
void *p = malloc(n);
@@
-34,7
+34,7
@@
static inline void *xmalloc(size_t n) {
return p;
}
return p;
}
-static inline void *xzalloc(size_t n)
__attribute__((__malloc__))
;
+static inline void *xzalloc(size_t n)
ATTR_MALLOC
;
static inline void *xzalloc(size_t n) {
void *p = calloc(1, n);
static inline void *xzalloc(size_t n) {
void *p = calloc(1, n);
@@
-55,7
+55,7
@@
static inline void *xrealloc(void *p, size_t n) {
return p;
}
return p;
}
-static inline char *xstrdup(const char *s)
__attribute__((__malloc__)) __attribute((__nonnull__))
;
+static inline char *xstrdup(const char *s)
ATTR_MALLOC ATTR_NONNULL
;
static inline char *xstrdup(const char *s) {
char *p = strdup(s);
static inline char *xstrdup(const char *s) {
char *p = strdup(s);
@@
-67,7
+67,7
@@
static inline char *xstrdup(const char *s) {
}
static inline int xvasprintf(char **strp, const char *fmt, va_list ap) {
}
static inline int xvasprintf(char **strp, const char *fmt, va_list ap) {
-#ifdef HAVE_
MINGW
+#ifdef HAVE_
WINDOWS
char buf[1024];
int result = vsnprintf(buf, sizeof(buf), fmt, ap);
char buf[1024];
int result = vsnprintf(buf, sizeof(buf), fmt, ap);
@@
-87,7
+87,7
@@
static inline int xvasprintf(char **strp, const char *fmt, va_list ap) {
return result;
}
return result;
}
-static inline int xasprintf(char **strp, const char *fmt, ...)
__attribute__((__format__(printf, 2, 3))
);
+static inline int xasprintf(char **strp, const char *fmt, ...)
ATTR_FORMAT(printf, 2, 3
);
static inline int xasprintf(char **strp, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
static inline int xasprintf(char **strp, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);