Skip to content

Commit e1f7980

Browse files
committed
./configure: check for keyname(3) added
1 parent f9c1e62 commit e1f7980

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

configure

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,28 @@ EOT
507507

508508
DEFS="$DEFS -DHAVE_CURSES_WCH"
509509
}
510+
check_curses_keyname () {
511+
check_for "keyname(3)"
512+
513+
cat <<EOT >$TMPC
514+
#include "compat.h"
515+
int
516+
main(int argc, char **argv) {
517+
(void)argv;
518+
puts(keyname(argc));
519+
return 0;
520+
}
521+
EOT
522+
gen_mk
523+
cat <<EOT >>$OUTMK
524+
$TMPNAM: ${TMPNAM}.o
525+
\$(CC) \$(_CFLAGS) \$(_LDFLAGS) \$(RPATH_CURSES) -o \$@ ${TMPNAM}.o \$(LDADD)
526+
EOT
527+
compile
528+
test_result || return;
529+
530+
DEFS="$DEFS -DHAVE_CURSES_KEYNAME"
531+
}
510532
check_isfinite () {
511533
check_for "isfinite(3)"
512534

@@ -578,6 +600,7 @@ check_strlcpy
578600
check_strlcat
579601
check_lib_curses
580602
check_curses_wch
603+
check_curses_keyname
581604
check_isfinite
582605

583606
gen_mk

pipe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ dogetkey(void) {
317317
if (c < 256) {
318318
snprintf(line, sizeof line, "%c", c);
319319
len = 1;
320+
#ifdef HAVE_CURSES_KEYNAME
320321
} else if (c >= KEY_MIN && c <= KEY_MAX) {
321322
int i, j;
322323
line[0] = '\0';
@@ -328,6 +329,7 @@ dogetkey(void) {
328329
line[i++] = line[j++];
329330
}
330331
len = strlen(line + 1) + 1;
332+
#endif
331333
} else {
332334
line[0] = '0';
333335
snprintf(line + 1, sizeof(line) - 1, "UNKNOWN KEY");

version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
*/
88

99
extern char *rev;
10-
char *rev = "$Revision: 7.16_1.1.1 170217 $";
10+
char *rev = "$Revision: 7.16_1.1.1 170828 1704 $";

0 commit comments

Comments
 (0)