Index: Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/Makefile,v retrieving revision 1.178 diff -u -r1.178 Makefile --- Makefile 12 Jul 2005 03:23:30 -0000 1.178 +++ Makefile 14 Jul 2005 03:56:10 -0000 @@ -240,7 +240,7 @@ CFLAGS+=-D__Darwin__ endif ifeq (${OSARCH},FreeBSD) -LIBS+=-lcrypto -lstrfunc +LIBS+=-lcrypto endif ifeq (${OSARCH},NetBSD) LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/local/lib -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.218 diff -u -r1.218 channel.c --- channel.c 12 Jul 2005 16:00:23 -0000 1.218 +++ channel.c 14 Jul 2005 03:56:14 -0000 @@ -31,12 +31,6 @@ #error "You need newer zaptel! Please cvs update zaptel" #endif #endif -#ifdef __FreeBSD__ -#include -#if (!defined(__STRFUNC_H__) && (!defined(STRFUNC_H))) -#error "Please install the strfunc library located in the ports collection at /usr/ports/devel/libstrfunc" -#endif -#endif #include "asterisk.h" @@ -1760,7 +1754,7 @@ if (f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HANGUP) done = 1; /* force a break */ else if (f->frametype == AST_FRAME_TEXT) { /* what we want */ - buf = strndup((char *)f->data, f->datalen); /* dup and break */ + buf = ast_strndup(f->data, f->datalen); /* dup and break */ done = 1; } ast_frfree(f); Index: utils.c =================================================================== RCS file: /usr/cvsroot/asterisk/utils.c,v retrieving revision 1.53 diff -u -r1.53 utils.c --- utils.c 24 Jun 2005 22:45:15 -0000 1.53 +++ utils.c 14 Jul 2005 03:56:14 -0000 @@ -9,9 +9,6 @@ * the GNU General Public License */ -#ifdef Linux /* For strcasestr */ -#define __USE_GNU -#endif #include #include #include @@ -495,8 +492,26 @@ return 0; } +/* Copy n number of characters and terminate with a null */ +char *ast_strndup(const char *s, size_t n) +{ + int len; + char *new = NULL; + + for (len=0; lenptr; \ }) -#ifdef __linux__ -#define ast_strcasestr strcasestr -#else +/*! + \brief same as strcasestr, locate a substring - ignores the case of both strings +*/ extern char *ast_strcasestr(const char *, const char *); -#endif /* __linux__ */ #endif /* _ASTERISK_STRINGS_H */