mirror of
https://github.com/troglobit/libite.git
synced 2026-11-07 16:01:01 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
113c3487bd
commit
59869b876e
1 file changed
+2
-1
@@ -37,7 +37,6 @@
|
|||||||
#if !HAVE_STRDUPA
|
#if !HAVE_STRDUPA
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
|
|
||||||
#include <string.h> /* memcpy(3) strlen(3) */
|
#include <string.h> /* memcpy(3) strlen(3) */
|
||||||
|
|
||||||
#define strdupa(src) (__extension__ ({ \
|
#define strdupa(src) (__extension__ ({ \
|
||||||
@@ -47,6 +46,8 @@
|
|||||||
(char *)memcpy(dst_, src, len_); \
|
(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 /* __GNUC__ */
|
||||||
#endif /* !HAVE_STRDUPA */
|
#endif /* !HAVE_STRDUPA */
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user