[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] include/MKterm.h.awk.in: Make term.h more comprehensible by
From: |
G. Branden Robinson |
Subject: |
[PATCH 1/2] include/MKterm.h.awk.in: Make term.h more comprehensible by humans. |
Date: |
Thu, 26 Dec 2024 21:32:29 -0600 |
"term.h" is generated via multiple levels of indirection, resulting in
preprocessor logic that can look like this.
#if 0 || 0
That's less silly than it looks, because those zeroes are the result of
textual substitution by an AWK script which is itself created by the
configure script.
But it is pretty unhelpful to people reading the header file. Disclose
the configuration-time selected and computed parameters that influence
these substitutions.
---
include/MKterm.h.awk.in | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in
index a93d8e86e..dffa5a55b 100644
--- a/include/MKterm.h.awk.in
+++ b/include/MKterm.h.awk.in
@@ -86,6 +86,7 @@ BEGIN {
print ""
print "typedef struct screen SCREEN;"
print ""
+ print "/* configured with --enable-sp-funcs? */"
print "#if @NCURSES_SP_FUNCS@"
print "#undef NCURSES_SP_FUNCS"
print "#define NCURSES_SP_FUNCS @NCURSES_PATCH@"
@@ -146,6 +147,7 @@ BEGIN {
print "#else /* !HAVE_TERMIO_H */"
print ""
print "#if (defined(_WIN32) || defined(_WIN64))"
+ print "/* configured with --enable-exp-win32? */"
print "#if @EXP_WIN32_DRIVER@"
print "#include <win32_curses.h>"
print "#define TTY struct winconmode"
@@ -166,6 +168,7 @@ BEGIN {
print "#ifdef TERMIOS"
print "#define GET_TTY(fd, buf) tcgetattr(fd, buf)"
print "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)"
+ print "/* configured with --enable-exp-win32? */"
print "#elif @EXP_WIN32_DRIVER@ && (defined(_WIN32) ||
defined(_WIN64))"
print "#define GET_TTY(fd, buf)
_nc_console_getmode(_nc_console_fd2handle(fd),buf)"
print "#define SET_TTY(fd, buf)
_nc_console_setmode(_nc_console_fd2handle(fd),buf)"
@@ -255,6 +258,7 @@ END {
print "TERMINAL;"
print ""
if (@NCURSES_EXT_COLORS@) {
+ print "/* configured with --enable-ext-colors */"
declare_termtype("int","2");
} else {
print "#undef TERMTYPE2"
@@ -268,9 +272,10 @@ END {
print ""
print "#endif /* NCURSES_INTERNALS */"
print ""
- print ""
+ print "/* configured with --enable-broken_linker and reentrancy
disabled */"
print "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+ print "/* reentrancy enabled */"
print "#elif @cf_cv_enable_reentrant@"
print "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
print "#define cur_term NCURSES_PUBLIC_VAR(cur_term())"
@@ -278,6 +283,7 @@ END {
print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
print "#endif"
print ""
+ print "/* configured with --enable-broken_linker or reentrancy enabled
*/"
print "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
@@ -348,6 +354,7 @@ END {
print "extern NCURSES_EXPORT(int) tigetflag (const char *);"
print "extern NCURSES_EXPORT(int) tigetnum (const char *);"
print ""
+ print "/* configured without --disable-tparm-varargs? */"
print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
print "extern NCURSES_EXPORT(char *) tparm (const char *, ...);
/* special */"
print "#else"
@@ -380,6 +387,7 @@ END {
print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag)
(SCREEN*, const char *);"
print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum)
(SCREEN*, const char *);"
print ""
+ print "/* configured without --disable-tparm-varargs? */"
print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*,
const char *, ...); /* special */"
print "#else"
--
2.30.2
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 1/2] include/MKterm.h.awk.in: Make term.h more comprehensible by humans.,
G. Branden Robinson <=