提交 f7b787c7 authored 作者: Michael Jerris's avatar Michael Jerris

fix bsd build

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5226 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f704b3f6
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
SUBDIRS = src examples doc SUBDIRS = src
## GENERATED BY SCRIPT - DO NOT EDIT BELOW ## GENERATED BY SCRIPT - DO NOT EDIT BELOW
......
...@@ -522,7 +522,9 @@ el_resize(EditLine *el) ...@@ -522,7 +522,9 @@ el_resize(EditLine *el)
sigset_t oset, nset; sigset_t oset, nset;
(void) sigemptyset(&nset); (void) sigemptyset(&nset);
#ifdef SIGWINCH
(void) sigaddset(&nset, SIGWINCH); (void) sigaddset(&nset, SIGWINCH);
#endif
(void) sigprocmask(SIG_BLOCK, &nset, &oset); (void) sigprocmask(SIG_BLOCK, &nset, &oset);
/* get the correct window size */ /* get the correct window size */
......
...@@ -83,9 +83,11 @@ sig_handler(int signo) ...@@ -83,9 +83,11 @@ sig_handler(int signo)
term__flush(); term__flush();
break; break;
#ifdef SIGWINCH
case SIGWINCH: case SIGWINCH:
el_resize(sel); el_resize(sel);
break; break;
#endif
default: default:
tty_cookedmode(sel); tty_cookedmode(sel);
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
* Define here all the signals we are going to handle * Define here all the signals we are going to handle
* The _DO macro is used to iterate in the source code * The _DO macro is used to iterate in the source code
*/ */
#ifdef SIGWINCH
#define ALLSIGS \ #define ALLSIGS \
_DO(SIGINT) \ _DO(SIGINT) \
_DO(SIGTSTP) \ _DO(SIGTSTP) \
...@@ -57,6 +58,16 @@ ...@@ -57,6 +58,16 @@
_DO(SIGTERM) \ _DO(SIGTERM) \
_DO(SIGCONT) \ _DO(SIGCONT) \
_DO(SIGWINCH) _DO(SIGWINCH)
#else
#define ALLSIGS \
_DO(SIGINT) \
_DO(SIGTSTP) \
_DO(SIGSTOP) \
_DO(SIGQUIT) \
_DO(SIGHUP) \
_DO(SIGTERM) \
_DO(SIGCONT)
#endif
typedef void (*el_signalhandler_t)(int); typedef void (*el_signalhandler_t)(int);
typedef el_signalhandler_t *el_signal_t; typedef el_signalhandler_t *el_signal_t;
......
...@@ -905,7 +905,9 @@ term_set(EditLine *el, const char *term) ...@@ -905,7 +905,9 @@ term_set(EditLine *el, const char *term)
int lins, cols; int lins, cols;
(void) sigemptyset(&nset); (void) sigemptyset(&nset);
#ifdef SIGWINCH
(void) sigaddset(&nset, SIGWINCH); (void) sigaddset(&nset, SIGWINCH);
#endif
(void) sigprocmask(SIG_BLOCK, &nset, &oset); (void) sigprocmask(SIG_BLOCK, &nset, &oset);
area = buf; area = buf;
......
...@@ -63,7 +63,7 @@ __weak_alias(strunvis,_strunvis) ...@@ -63,7 +63,7 @@ __weak_alias(strunvis,_strunvis)
#define S_HEX1 7 /* hex digit */ #define S_HEX1 7 /* hex digit */
#define S_HEX2 8 /* hex digit 2 */ #define S_HEX2 8 /* hex digit 2 */
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') #define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10)) #define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
/* /*
......
...@@ -915,14 +915,14 @@ vi_comment_out(EditLine *el, int c) ...@@ -915,14 +915,14 @@ vi_comment_out(EditLine *el, int c)
* NB: posix implies that we should enter insert mode, however * NB: posix implies that we should enter insert mode, however
* this is against historical precedent... * this is against historical precedent...
*/ */
#ifdef __weak_reference #if defined(__weak_reference) && !defined(__FreeBSD__)
extern char *get_alias_text(const char *) __weak_reference(get_alias_text); extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
#endif #endif
protected el_action_t protected el_action_t
/*ARGSUSED*/ /*ARGSUSED*/
vi_alias(EditLine *el, int c) vi_alias(EditLine *el, int c)
{ {
#ifdef __weak_reference #if defined(__weak_reference) && !defined(__FreeBSD__)
char alias_name[3]; char alias_name[3];
char *alias_text; char *alias_text;
......
...@@ -106,7 +106,7 @@ __weak_alias(vis,_vis) ...@@ -106,7 +106,7 @@ __weak_alias(vis,_vis)
#undef BELL #undef BELL
#define BELL '\a' #define BELL '\a'
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') #define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
#define iswhite(c) (c == ' ' || c == '\t' || c == '\n') #define iswhite(c) (c == ' ' || c == '\t' || c == '\n')
#define issafe(c) (c == '\b' || c == BELL || c == '\r') #define issafe(c) (c == '\b' || c == BELL || c == '\r')
#define xtoa(c) "0123456789abcdef"[c] #define xtoa(c) "0123456789abcdef"[c]
...@@ -208,8 +208,8 @@ do { \ ...@@ -208,8 +208,8 @@ do { \
} \ } \
if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \ if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \
*dst++ = '\\'; \ *dst++ = '\\'; \
*dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; \ *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 6) & 03) + '0'; \
*dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; \ *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 3) & 07) + '0'; \
*dst++ = (c & 07) + '0'; \ *dst++ = (c & 07) + '0'; \
} else { \ } else { \
if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \ if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论