aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-27 21:34:27 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-27 21:34:27 +0000
commit246797b309ef964e7bd9ac2082d0ef42944c0e9d (patch)
tree4f1a556ee7a811109d8fb9674e218052955e0083 /include/asterisk/channel.h
parentdccdbdeeb39de2990741e60c9d85013c807f3e93 (diff)
More contributed BSD enhancements
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@919 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/channel.h')
-rwxr-xr-xinclude/asterisk/channel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index befc13bc5..c67dd58c4 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -708,6 +708,17 @@ static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
#endif
}
+#if !defined(ast_strdupa) && defined(__GNUC__)
+# define ast_strdupa(s) \
+ (__extension__ \
+ ({ \
+ __const char *__old = (s); \
+ size_t __len = strlen (__old) + 1; \
+ char *__new = (char *) __builtin_alloca (__len); \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+#endif
+
#ifdef DO_CRASH
#define CRASH do { fprintf(stderr, "!! Forcing immediate crash a-la abort !!\n"); *((int *)0) = 0; } while(0)
#else