Fix the MSDOS build

* msdos/sedlibmk.inp (GL_GNULIB_STDC_[^ =] &c.): Rename from
GL_STDC_... and define to 1 before other variables prefixed
GL_GNULIB_ are defined to 0.
(NEXT_AS_FIRST_DIRECTIVE_STDBIT_H)
(NEXT_AS_FIRST_DIRECTIVE_STDCOUNTOF_H, STDCOUNTOF_H): Define.
(GL_HAVE_STDBIT_H_CONDITION): Replace
GL_GENERATE_STDBIT_H_CONDITION.
(CXX_HAVE_STDCOUNTOF_H, GL_GNULIB_STREQ, GL_GNULIB_MEMEQ)
(GL_GNULIB_STRNUL, GL_GENERATE_STDCOUNTOF_H_CONDITION):
Substitute "1".

* src/conf_post.h (_REGEX_AVOID_UCHAR_H) [MSDOS]: Define to 1.

* src/term.c (init_tty) [MSDOS]: Set TN_max_colors to 16,
which was deleted inadvertently with recent MS Windows
modifications.

* config.bat: Rename stdcountof.in.h appropriately.
This commit is contained in:
Po Lu 2026-05-28 11:33:59 +08:00
parent 330b4e2a94
commit de926d281a
4 changed files with 26 additions and 5 deletions

View file

@ -292,6 +292,7 @@ If Exist limits.in.h update limits.in.h limits.in-h
If Exist signal.in.h update signal.in.h signal.in-h If Exist signal.in.h update signal.in.h signal.in-h
If Exist signal.in.h update signal.in.h signal.in-h If Exist signal.in.h update signal.in.h signal.in-h
If Exist stdalign.in.h update stdalign.in.h stdalign.in-h If Exist stdalign.in.h update stdalign.in.h stdalign.in-h
If Exist stdcountof.in.h update stdcountof.in.h stdcountof.in-h
If Exist stddef.in.h update stddef.in.h stddef.in-h If Exist stddef.in.h update stddef.in.h stddef.in-h
If Exist stdint.in.h update stdint.in.h stdint.in-h If Exist stdint.in.h update stdint.in.h stdint.in-h
If Exist stdio.in.h update stdio.in.h stdio.in-h If Exist stdio.in.h update stdio.in.h stdio.in-h

View file

@ -50,6 +50,14 @@
# s/^@GL_GENERATE_STDBOOL_H@/1/ # s/^@GL_GENERATE_STDBOOL_H@/1/
# s/^@GL_GENERATE_STDINT_H@// # s/^@GL_GENERATE_STDINT_H@//
# #
# . Functions defined in these headers may also be conditional upon
# variables substituted into the generated products bearing the
# prefix GL_GNULIB_. Be certain to examine updates to gnulib.mk for
# any variables of this description, and edit them to 1 if the
# functions they control must be defined, e.g.:
#
# /^GL_GNULIB_STREQ *=/s/@GL_GNULIB_STREQ@/1/
#
# . Also edit the NEXT_foo_H and NEXT_AS_FIRST_DIRECTIVE_foo_H # . Also edit the NEXT_foo_H and NEXT_AS_FIRST_DIRECTIVE_foo_H
# variables as appropriately: to an empty value if the gnulib # variables as appropriately: to an empty value if the gnulib
# header is not used, and to the corresponding DJGPP header name # header is not used, and to the corresponding DJGPP header name
@ -170,6 +178,7 @@ s/@PACKAGE@/emacs/
/^BITSIZEOF_WCHAR_T *=/s/@BITSIZEOF_WCHAR_T@/16/ /^BITSIZEOF_WCHAR_T *=/s/@BITSIZEOF_WCHAR_T@/16/
/^BITSIZEOF_WINT_T *=/s/@BITSIZEOF_WINT_T@/32/ /^BITSIZEOF_WINT_T *=/s/@BITSIZEOF_WINT_T@/32/
/^APPLE_UNIVERSAL_BUILD *=/s/@APPLE_UNIVERSAL_BUILD@/0/ /^APPLE_UNIVERSAL_BUILD *=/s/@APPLE_UNIVERSAL_BUILD@/0/
/^CXX_HAVE_STDCOUNTOF_H *=/s/@CXX_HAVE_STDCOUNTOF_H@/0/
# Most GL_GNULIB_* are replaced with zero even though DJGPP does not # Most GL_GNULIB_* are replaced with zero even though DJGPP does not
# have these features. That's because the gnulib replacements cannot # have these features. That's because the gnulib replacements cannot
# possibly work for DJGPP, so we prefer to fail the link than have a # possibly work for DJGPP, so we prefer to fail the link than have a
@ -186,10 +195,12 @@ s/@PACKAGE@/emacs/
/^GL_GNULIB_MEMMEM *=/s/@GL_GNULIB_MEMMEM@/1/ /^GL_GNULIB_MEMMEM *=/s/@GL_GNULIB_MEMMEM@/1/
/^GL_GNULIB_MEMRCHR *=/s/@GL_GNULIB_MEMRCHR@/1/ /^GL_GNULIB_MEMRCHR *=/s/@GL_GNULIB_MEMRCHR@/1/
/^GL_GNULIB_MEMPCPY *=/s/@GL_GNULIB_MEMPCPY@/1/ /^GL_GNULIB_MEMPCPY *=/s/@GL_GNULIB_MEMPCPY@/1/
/^GL_GNULIB_MEMEQ *=/s/@GL_GNULIB_MEMEQ@/1/
/^GL_GNULIB_MKOSTEMP *=/s/@GL_GNULIB_MKOSTEMP@/1/ /^GL_GNULIB_MKOSTEMP *=/s/@GL_GNULIB_MKOSTEMP@/1/
/^GL_GNULIB_MKTIME *=/s/@GL_GNULIB_MKTIME@/1/ /^GL_GNULIB_MKTIME *=/s/@GL_GNULIB_MKTIME@/1/
/^GL_GNULIB_SIGDESCR_NP *=/s/@GL_GNULIB_SIGDESCR_NP@/1/ /^GL_GNULIB_SIGDESCR_NP *=/s/@GL_GNULIB_SIGDESCR_NP@/1/
/^GL_GNULIB_STRINGEQ *=/s/@GL_GNULIB_STRINGEQ@/1/ /^GL_GNULIB_STREQ *=/s/@GL_GNULIB_STREQ@/1/
/^GL_GNULIB_STRNUL *=/s/@GL_GNULIB_STRNUL@/1/
/^GL_GNULIB_TIME_R *=/s/@GL_GNULIB_TIME_R@/1/ /^GL_GNULIB_TIME_R *=/s/@GL_GNULIB_TIME_R@/1/
/^GL_GNULIB_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/1/ /^GL_GNULIB_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/1/
/^GL_GNULIB_TIME_RZ *=/s/@GL_GNULIB_TIME_RZ@/1/ /^GL_GNULIB_TIME_RZ *=/s/@GL_GNULIB_TIME_RZ@/1/
@ -197,10 +208,10 @@ s/@PACKAGE@/emacs/
# Apparently without this `rawmemchr' isn't declared, so # Apparently without this `rawmemchr' isn't declared, so
# we get warnings building canonicalize-lgpl.o # we get warnings building canonicalize-lgpl.o
/^GL_GNULIB_RAWMEMCHR *=/s/@GL_GNULIB_RAWMEMCHR@/1/ /^GL_GNULIB_RAWMEMCHR *=/s/@GL_GNULIB_RAWMEMCHR@/1/
/^GL_GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/
# These variables control whether ISO C23 features are generated, # These variables control whether ISO C23 features are generated,
# e.g. those in stdbit.h. # e.g. those in stdbit.h.
/^GL_STDC_[^ =]* *= *@/s/@[^@\n]*@/1/ /^GL_GNULIB_STDC_[^ =]* *= *@/s/@[^@\n]*@/1/
/^GL_GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/
/^GL_GSETTINGS_CFLAGS *=/s/@[^@\n]*@// /^GL_GSETTINGS_CFLAGS *=/s/@[^@\n]*@//
/^GL_GSETTINGS_LIBS *=/s/@[^@\n]*@// /^GL_GSETTINGS_LIBS *=/s/@[^@\n]*@//
# Miscellaneous variables. # Miscellaneous variables.
@ -288,13 +299,15 @@ s/@PACKAGE@/emacs/
# are created in config.bat!) # are created in config.bat!)
/^MKDIR_P *=/s/@MKDIR_P@/echo/ /^MKDIR_P *=/s/@MKDIR_P@/echo/
/^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@/<dirent.h>/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@/<dirent.h>/
/^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@//
/^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s|@[^@\n]*@|<machine/endian.h>| /^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s|@[^@\n]*@|<machine/endian.h>|
/^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@//
/^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@/<fcntl.h>/ /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@/<fcntl.h>/
/^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/ /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
/^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@/<limits.h>/ /^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@/<limits.h>/
/^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/ /^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDBIT_H *=/s/@[^@\n]*@/<stdbit.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDCKDINT_H *=/s/@[^@\n]*@/<stdckdint.h>/ /^NEXT_AS_FIRST_DIRECTIVE_STDCKDINT_H *=/s/@[^@\n]*@/<stdckdint.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDCOUNTOF_H *=/s/@[^@\n]*@/<stdcountof.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@/<stddef.h>/ /^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@/<stddef.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/ /^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/ /^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
@ -359,6 +372,7 @@ s/@PACKAGE@/emacs/
/^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/ /^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/
/^STDBIT_H *=/s/@[^@\n]*@/stdbit.h/ /^STDBIT_H *=/s/@[^@\n]*@/stdbit.h/
/^STDCKDINT_H *=/s/@[^@\n]*@/stdckdint.h/ /^STDCKDINT_H *=/s/@[^@\n]*@/stdckdint.h/
/^STDCOUNTOF_H *=/s/@[^@\n]*@/stdcountof.h/
/^STDDEF_H *=/s/@[^@\n]*@/stddef.h/ /^STDDEF_H *=/s/@[^@\n]*@/stddef.h/
/^STDDEF_NOT_IDEMPOTENT *=/s/@[^@\n]*@/1/ /^STDDEF_NOT_IDEMPOTENT *=/s/@[^@\n]*@/1/
/^STDINT_H *=/s/@[^@\n]*@/stdint.h/ /^STDINT_H *=/s/@[^@\n]*@/stdint.h/
@ -448,6 +462,7 @@ s/= @GL_GENERATE_ENDIAN_H_CONDITION@/= 1/
s/= @GL_GENERATE_EXECINFO_H_CONDITION@/= 1/ s/= @GL_GENERATE_EXECINFO_H_CONDITION@/= 1/
s/= @GL_GENERATE_IEEE754_H_CONDITION@/= 1/ s/= @GL_GENERATE_IEEE754_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDALIGN_H_CONDITION@/= 1/ s/= @GL_GENERATE_STDALIGN_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDCOUNTOF_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDDEF_H_CONDITION@/= 1/ s/= @GL_GENERATE_STDDEF_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/ s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/
s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/ s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/
@ -458,7 +473,7 @@ s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/
s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= / s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= /
s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/ s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDCKDINT_H_CONDITION@/= 1/ s/= @GL_GENERATE_STDCKDINT_H_CONDITION@/= 1/
s/= @GL_GENERATE_STDBIT_H_CONDITION@/= 1/ s/= @GL_HAVE_STDBIT_H_CONDITION@/= 0/
s/= @GL_COND_OBJ_STDIO_READ_CONDITION@/= / s/= @GL_COND_OBJ_STDIO_READ_CONDITION@/= /
s/= @GL_COND_OBJ_STDIO_WRITE_CONDITION@/= / s/= @GL_COND_OBJ_STDIO_WRITE_CONDITION@/= /
s/= @GL_COND_OBJ_STPNCPY_CONDITION@/= / s/= @GL_COND_OBJ_STPNCPY_CONDITION@/= /

View file

@ -386,6 +386,10 @@ extern int emacs_setenv_TZ (char const *);
: S_ISLNK (mode) ? DT_LNK : S_ISBLK (mode) ? DT_BLK \ : S_ISLNK (mode) ? DT_LNK : S_ISBLK (mode) ? DT_BLK \
: S_ISCHR (mode) ? DT_CHR : S_ISFIFO (mode) ? DT_FIFO \ : S_ISCHR (mode) ? DT_CHR : S_ISFIFO (mode) ? DT_FIFO \
: S_ISSOCK (mode) ? DT_SOCK : DT_UNKNOWN) : S_ISSOCK (mode) ? DT_SOCK : DT_UNKNOWN)
/* DJGPP doesn't provide uchar.h and Emacs doesn't import Gnulib's
replacement either. */
#define _REGEX_AVOID_UCHAR_H 1
#endif /* MSDOS */ #endif /* MSDOS */
#if defined WINDOWSNT && !(defined OMIT_CONSOLESAFE && OMIT_CONSOLESAFE == 1) #if defined WINDOWSNT && !(defined OMIT_CONSOLESAFE && OMIT_CONSOLESAFE == 1)

View file

@ -4751,6 +4751,7 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
FrameCols (tty) = width; FrameCols (tty) = width;
FrameRows (tty) = height; FrameRows (tty) = height;
tty->char_ins_del_ok = 0; tty->char_ins_del_ok = 0;
tty->TN_max_colors = 16; /* Must be non-zero for tty-display-color-p. */
init_baud_rate (fileno (tty->input)); init_baud_rate (fileno (tty->input));
} }
#endif /* MSDOS */ #endif /* MSDOS */