From 59869b876e6a7a5fcabdb14a170bccb050ac8150 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 2 Jun 2016 19:49:34 +0200 Subject: [PATCH] strdupa.h: #error if building with non-GCC on non-GNU systems At the moment only GCC is supported on non-GNU systems, unfortunately. GNU systems usually have GLIBC, or another library with strdupa(). This strdupa() implementation requires GCC for the builtin alloca API. Followup to pull-request #4 Signed-off-by: Joachim Nilsson --- strdupa.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strdupa.h b/strdupa.h index aadc607..ae845d9 100644 --- a/strdupa.h +++ b/strdupa.h @@ -37,7 +37,6 @@ #if !HAVE_STRDUPA #if defined(__GNUC__) #include /* size_t */ - #include /* memcpy(3) strlen(3) */ #define strdupa(src) (__extension__ ({ \ @@ -47,6 +46,8 @@ (char *)memcpy(dst_, src, len_); \ })) +#else /* If not GCC, e.g. Clang */ +#error strdupa() may use an unsupported GNU C API, please forward any fix to maintainer, cheers! #endif /* __GNUC__ */ #endif /* !HAVE_STRDUPA */