aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-25 23:09:08 +0200
committerMattias Andrée <maandree@kth.se>2018-08-25 23:09:08 +0200
commitcc1d8fa9c948c0ef4b1e825e0583fbf73c79f3fd (patch)
treeadd42684ef72a048ce4561af11cdeafaf4604f79
parentSome fixes and more tests (diff)
downloadlibsimple-cc1d8fa9c948c0ef4b1e825e0583fbf73c79f3fd.tar.gz
libsimple-cc1d8fa9c948c0ef4b1e825e0583fbf73c79f3fd.tar.bz2
libsimple-cc1d8fa9c948c0ef4b1e825e0583fbf73c79f3fd.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libsimple.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/libsimple.h b/libsimple.h
index 4d3520e..a9562ff 100644
--- a/libsimple.h
+++ b/libsimple.h
@@ -633,9 +633,8 @@ int libsimple_vasprintf(char **, const char *, va_list);
#endif
-#ifndef asprintfa
-# if defined(__GNUC__) && !defined(__clang__)
-# define asprintfa(__fmt, ...) /* TODO test */\
+#if defined(__GNUC__) && !defined(__clang__)
+# define libsimple_asprintfa(__fmt, ...) /* TODO test */\
({\
const char *__f = (__fmt);\
char *__ret = NULL;\
@@ -651,13 +650,14 @@ int libsimple_vasprintf(char **, const char *, va_list);
__ret;\
}\
})
+# ifndef asprintfa
+# define asprintfa(...) libsimple_asprintfa(__VA_ARGS__)
# endif
#endif
-#ifndef vasprintfa
-# if defined(__GNUC__) || defined(__clang__)
-# define vasprintfa(__fmt, __ap) /* TODO test */\
+#if defined(__GNUC__) || defined(__clang__)
+# define libsimple_vasprintfa(__fmt, __ap) /* TODO test */\
({\
const char *__f = (__fmt);\
va_list __a = (__ap);\
@@ -676,6 +676,8 @@ int libsimple_vasprintf(char **, const char *, va_list);
va_end(__a2);\
__ret;\
})
+# ifndef vasprintfa
+# define vasprintfa(fmt, ap) libsimple_vasprintfa(fmt, ap)
# endif
#endif