From 689448a0418da3d3a15d137fa92f27d00c30624f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 27 May 2026 16:30:23 +0300 Subject: [PATCH 1/6] Unbreak MS-Windows build broken by Gnulib sync * src/conf_post.h: Add leading underscores to 'gl_consolesafe_*' functions, to follow Gnulib's renaming. * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load): Revert previous change that removed "useless" casts, as removing them triggers warnings from MinGW GCC 9.2. --- src/conf_post.h | 26 +++++++++++++------------- src/image.c | 15 ++++++++------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/conf_post.h b/src/conf_post.h index 5b7548f20fa..20a9ce2609b 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -402,28 +402,28 @@ extern int emacs_setenv_TZ (char const *); Gnulib stdio-h module, which does the below in Gnulib's stdio.h file, which is not used by the MS-Windows build. */ -extern size_t gl_consolesafe_fwrite (const void *ptr, size_t size, - size_t nmemb, FILE *fp) +extern size_t _gl_consolesafe_fwrite (const void *ptr, size_t size, + size_t nmemb, FILE *fp) ARG_NONNULL ((1, 4)); -extern int gl_consolesafe_fprintf (FILE *restrict fp, - const char *restrict format, ...) +extern int _gl_consolesafe_fprintf (FILE *restrict fp, + const char *restrict format, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3) ARG_NONNULL ((1, 2)); -extern int gl_consolesafe_printf (const char *restrict format, ...) +extern int _gl_consolesafe_printf (const char *restrict format, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2) ARG_NONNULL ((1)); -extern int gl_consolesafe_vfprintf (FILE *restrict fp, - const char *restrict format, va_list args) +extern int _gl_consolesafe_vfprintf (FILE *restrict fp, + const char *restrict format, va_list args) ATTRIBUTE_FORMAT_PRINTF (2, 0) ARG_NONNULL ((1, 2)); -extern int gl_consolesafe_vprintf (const char *restrict format, va_list args) +extern int _gl_consolesafe_vprintf (const char *restrict format, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0) ARG_NONNULL ((1)); -# define fwrite gl_consolesafe_fwrite -# define fprintf gl_consolesafe_fprintf -# define printf gl_consolesafe_printf -# define vfprintf gl_consolesafe_vfprintf -# define vprintf gl_consolesafe_vprintf +# define fwrite _gl_consolesafe_fwrite +# define fprintf _gl_consolesafe_fprintf +# define printf _gl_consolesafe_printf +# define vfprintf _gl_consolesafe_vfprintf +# define vprintf _gl_consolesafe_vprintf # endif /* !_UCRT */ # if !HAVE_DECL_GETDELIM diff --git a/src/image.c b/src/image.c index 640e3736b08..4d6affaf849 100644 --- a/src/image.c +++ b/src/image.c @@ -7840,7 +7840,8 @@ pbm_load (struct frame *f, struct image *img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -8586,7 +8587,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) img->height = height; /* Maybe fill in the background field while we have ximg handy. */ - IMAGE_BACKGROUND (img, f, ximg); + IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -8595,8 +8596,8 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) if (mask_img) { /* Fill in the background_transparent field while we have the - mask handy. */ - image_background_transparent (img, f, mask_img); + mask handy. Casting avoids a GCC warning. */ + image_background_transparent (img, f, (Emacs_Pix_Context)mask_img); image_put_x_image (f, img, mask_img, 1); } @@ -9163,7 +9164,7 @@ jpeg_load_body (struct frame *f, struct image *img, /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -9603,7 +9604,7 @@ tiff_load (struct frame *f, struct image *img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -10325,7 +10326,7 @@ gif_load (struct frame *f, struct image *img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); From 967d8182cfa2d6c845853210e4fd4ab398efe069 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 26 May 2026 23:44:32 -0700 Subject: [PATCH 2/6] pgtk: Fix -Wint-conversion compilation error. * src/pgtkgui.h (WINDOW_HANDLE_UINTPTR): New macro to override the default one in src/dispextern.h. --- src/pgtkgui.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pgtkgui.h b/src/pgtkgui.h index 327059fd36c..4179f1ca141 100644 --- a/src/pgtkgui.h +++ b/src/pgtkgui.h @@ -49,6 +49,8 @@ typedef void *Color; typedef int Window; typedef struct _GdkDisplay Display; +#define WINDOW_HANDLE_UINTPTR(h) ((uintptr_t) (h)) + /* Xism */ typedef void *XrmDatabase; From 54b6ea14a928d015098c41f88aff126df169fecc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 27 May 2026 08:37:01 -0700 Subject: [PATCH 3/6] Port MinGW GCC 9.2 image.c fix to non MS-Windows Avoid useless casts on GCC 14+ platforms on non MS-Windows, by using a cast only if HAVE_NTGUI. That cast should not provoke -Wuseless-cast regardless of how MS-Windows defines HDC, since it casts to an Emacs-defined type. This change lets the code compile again on Fedora 44 with --enable-gcc-warnings. * src/dispextern.h (PIX_CONTAINER_TO_CONTEXT): New macro. It defaults to the identity macro. (Emacs_Pix_Context): Default to Emacs_Pix_Container. * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load, gif_load, svg_load_image): Use the new macro instead of a cast. --- src/dispextern.h | 14 +++++++++----- src/image.c | 14 +++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/dispextern.h b/src/dispextern.h index 4071ca57f72..129c94f0dd6 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -115,7 +115,6 @@ xstrcasecmp (char const *a, char const *b) typedef struct x_display_info Display_Info; #ifndef USE_CAIRO typedef XImage *Emacs_Pix_Container; -typedef XImage *Emacs_Pix_Context; #endif /* !USE_CAIRO */ #define NativeRectangle XRectangle #endif @@ -130,7 +129,6 @@ typedef struct int bits_per_pixel; /* bits per pixel (ZPixmap) */ } *Emacs_Pix_Container; typedef Emacs_Pix_Container Emacs_Pixmap; -typedef Emacs_Pix_Container Emacs_Pix_Context; #endif #ifdef HAVE_NTGUI @@ -138,6 +136,7 @@ typedef Emacs_Pix_Container Emacs_Pix_Context; typedef struct w32_display_info Display_Info; typedef XImage *Emacs_Pix_Container; typedef HDC Emacs_Pix_Context; +# define PIX_CONTAINER_TO_CONTEXT(c) ((Emacs_Pix_Context) (c)) #endif #ifdef HAVE_NS @@ -145,7 +144,6 @@ typedef HDC Emacs_Pix_Context; /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ typedef struct ns_display_info Display_Info; typedef Emacs_Pixmap Emacs_Pix_Container; -typedef Emacs_Pixmap Emacs_Pix_Context; #endif #ifdef HAVE_PGTK @@ -160,14 +158,12 @@ typedef XImagePtr XImagePtr_or_DC; #include "haikugui.h" typedef struct haiku_display_info Display_Info; typedef Emacs_Pixmap Emacs_Pix_Container; -typedef Emacs_Pixmap Emacs_Pix_Context; #endif #ifdef HAVE_ANDROID #include "androidgui.h" typedef struct android_display_info Display_Info; typedef struct android_image *Emacs_Pix_Container; -typedef struct android_image *Emacs_Pix_Context; #endif #ifdef HAVE_WINDOW_SYSTEM @@ -193,6 +189,14 @@ typedef void *Emacs_Cursor; # define WINDOW_HANDLE_UINTPTR(h) ((uintptr_t) {(h)}) # endif +/* Ordinarily an Emacs_Pix_Context is just an Emacs_Pix_Container; + platforms can override this by defining the latter type + and defining the conversion macro PIX_CONTAINER_TO_CONTEXT. */ +# ifndef PIX_CONTAINER_TO_CONTEXT +typedef Emacs_Pix_Container Emacs_Pix_Context; +# define PIX_CONTAINER_TO_CONTEXT(c) (c) +# endif + /* ``box'' structure similar to that found in the X sample server, meaning that X2 and Y2 are not actually the end of the box, but one pixel past the end of the box, which makes checking for overlaps diff --git a/src/image.c b/src/image.c index 4d6affaf849..9724094f81c 100644 --- a/src/image.c +++ b/src/image.c @@ -7841,7 +7841,7 @@ pbm_load (struct frame *f, struct image *img) if (NILP (image_spec_value (img->spec, QCbackground, NULL))) /* Casting avoids a GCC warning. */ - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -8587,7 +8587,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) img->height = height; /* Maybe fill in the background field while we have ximg handy. */ - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -8597,7 +8597,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) { /* Fill in the background_transparent field while we have the mask handy. Casting avoids a GCC warning. */ - image_background_transparent (img, f, (Emacs_Pix_Context)mask_img); + image_background_transparent (img, f, PIX_CONTAINER_TO_CONTEXT (mask_img)); image_put_x_image (f, img, mask_img, 1); } @@ -9164,7 +9164,7 @@ jpeg_load_body (struct frame *f, struct image *img, /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -9604,7 +9604,7 @@ tiff_load (struct frame *f, struct image *img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -10326,7 +10326,7 @@ gif_load (struct frame *f, struct image *img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); @@ -12510,7 +12510,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, /* Maybe fill in the background field while we have ximg handy. Casting avoids a GCC warning. */ - IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg); + IMAGE_BACKGROUND (img, f, PIX_CONTAINER_TO_CONTEXT (ximg)); /* Put ximg into the image. */ image_put_x_image (f, img, ximg, 0); From 6728239f32f7be4e9974b9f1bfc650b2f1083e82 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 27 May 2026 13:55:27 -0700 Subject: [PATCH 4/6] Use compound literal in lisp_h_make_fixnum_wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/lisp.h (lisp_h_make_fixnum_wrap) [USE_LSB_TAG]: Use compound literal, not cast. This pacifies -Wuseless-cast when building on Fedora 44 x86-64 with ‘./configure --enable-gcc-warnings CFLAGS='-O2 -DDEFINE_KEY_OPS_AS_MACROS'’. --- src/lisp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lisp.h b/src/lisp.h index 764205dcf90..370c8effa48 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -407,7 +407,7 @@ typedef EMACS_INT Lisp_Word; #define lisp_h_XHASH(a) XUFIXNUM_RAW (a) #if USE_LSB_TAG # define lisp_h_make_fixnum_wrap(n) \ - XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0)) + XIL ((EMACS_INT) (((EMACS_UINT) {(n)} << INTTYPEBITS) + Lisp_Int0)) # if defined HAVE_STATEMENT_EXPRESSIONS && defined HAVE_TYPEOF # define lisp_h_make_fixnum(n) \ ({ typeof (+(n)) lisp_h_make_fixnum_n = n; \ From 330b4e2a942a6ff506bab72503f940c9b65d395f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 28 May 2026 11:31:16 +0800 Subject: [PATCH 5/6] Fix the Android build again * exec/trace.c (ARRAYELTS, establish_seccomp_filter): Restore ARRAYELTS, since Gnulib is not available in the exec library. --- exec/trace.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/exec/trace.c b/exec/trace.c index a194b87ca84..da9ac96c6ff 100644 --- a/exec/trace.c +++ b/exec/trace.c @@ -28,7 +28,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include #include @@ -1539,6 +1538,9 @@ static int interesting_syscalls[] = READLINKAT_SYSCALL, }; +/* Number of elements in an array. */ +#define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0]) + /* Install a secure computing filter that will notify attached tracers when a system call of interest to this module is received. Value is 0 if successful, 1 otherwise. */ @@ -1546,7 +1548,7 @@ static int interesting_syscalls[] = static int establish_seccomp_filter (void) { - struct sock_filter statements[1 + countof (interesting_syscalls) + 2]; + struct sock_filter statements[1 + ARRAYELTS (interesting_syscalls) + 2]; struct sock_fprog program; int index, rc; @@ -1565,27 +1567,27 @@ establish_seccomp_filter (void) statements[index] = ((struct sock_filter) BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, EXEC_SYSCALL, - countof (interesting_syscalls), 0)); index++; + ARRAYELTS (interesting_syscalls), 0)); index++; #ifdef OPEN_SYSCALL statements[index] = ((struct sock_filter) BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, OPEN_SYSCALL, - countof (interesting_syscalls) - index + 1, 0)); index++; + ARRAYELTS (interesting_syscalls) - index + 1, 0)); index++; #endif /* OPEN_SYSCALL */ statements[index] = ((struct sock_filter) BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, OPENAT_SYSCALL, - countof (interesting_syscalls) - index + 1, 0)); index++; + ARRAYELTS (interesting_syscalls) - index + 1, 0)); index++; #ifdef READLINK_SYSCALL statements[index] = ((struct sock_filter) BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, READLINK_SYSCALL, - countof (interesting_syscalls) - index + 1, 0)); index++; + ARRAYELTS (interesting_syscalls) - index + 1, 0)); index++; #endif /* READLINK_SYSCALL */ statements[index] = ((struct sock_filter) BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, READLINKAT_SYSCALL, - countof (interesting_syscalls) - index + 1, 0)); index++; + ARRAYELTS (interesting_syscalls) - index + 1, 0)); index++; /* If not intercepted above, permit this system call to execute as normal. */ @@ -1598,7 +1600,7 @@ establish_seccomp_filter (void) if (rc) return 1; - program.len = countof (statements); + program.len = ARRAYELTS (statements); program.filter = statements; rc = prctl (PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &program); if (rc) From de926d281a111a86b1907636c958508e1b71e198 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 28 May 2026 11:33:59 +0800 Subject: [PATCH 6/6] 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. --- config.bat | 1 + msdos/sedlibmk.inp | 25 ++++++++++++++++++++----- src/conf_post.h | 4 ++++ src/term.c | 1 + 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/config.bat b/config.bat index 91d41f8fbfb..c52410929ef 100644 --- a/config.bat +++ b/config.bat @@ -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 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 stdint.in.h update stdint.in.h stdint.in-h If Exist stdio.in.h update stdio.in.h stdio.in-h diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index d29fc6ebca7..f742db263fe 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -50,6 +50,14 @@ # s/^@GL_GENERATE_STDBOOL_H@/1/ # 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 # variables as appropriately: to an empty value if the gnulib # 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_WINT_T *=/s/@BITSIZEOF_WINT_T@/32/ /^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 # have these features. That's because the gnulib replacements cannot # 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_MEMRCHR *=/s/@GL_GNULIB_MEMRCHR@/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_MKTIME *=/s/@GL_GNULIB_MKTIME@/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_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/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 # we get warnings building canonicalize-lgpl.o /^GL_GNULIB_RAWMEMCHR *=/s/@GL_GNULIB_RAWMEMCHR@/1/ -/^GL_GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/ # These variables control whether ISO C23 features are generated, # 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_LIBS *=/s/@[^@\n]*@// # Miscellaneous variables. @@ -288,13 +299,15 @@ s/@PACKAGE@/emacs/ # are created in config.bat!) /^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// -/^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s|@[^@\n]*@|| +/^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@// +/^NEXT_AS_FIRST_DIRECTIVE_STDBIT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDCKDINT_H *=/s/@[^@\n]*@// +/^NEXT_AS_FIRST_DIRECTIVE_STDCOUNTOF_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@[^@\n]*@// @@ -359,6 +372,7 @@ s/@PACKAGE@/emacs/ /^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/ /^STDBIT_H *=/s/@[^@\n]*@/stdbit.h/ /^STDCKDINT_H *=/s/@[^@\n]*@/stdckdint.h/ +/^STDCOUNTOF_H *=/s/@[^@\n]*@/stdcountof.h/ /^STDDEF_H *=/s/@[^@\n]*@/stddef.h/ /^STDDEF_NOT_IDEMPOTENT *=/s/@[^@\n]*@/1/ /^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_IEEE754_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_STDINT_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_MINI_GMP_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_WRITE_CONDITION@/= / s/= @GL_COND_OBJ_STPNCPY_CONDITION@/= / diff --git a/src/conf_post.h b/src/conf_post.h index 20a9ce2609b..e0bb753df56 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -386,6 +386,10 @@ extern int emacs_setenv_TZ (char const *); : S_ISLNK (mode) ? DT_LNK : S_ISBLK (mode) ? DT_BLK \ : S_ISCHR (mode) ? DT_CHR : S_ISFIFO (mode) ? DT_FIFO \ : 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 */ #if defined WINDOWSNT && !(defined OMIT_CONSOLESAFE && OMIT_CONSOLESAFE == 1) diff --git a/src/term.c b/src/term.c index 2261293a60b..1a5ed74d698 100644 --- a/src/term.c +++ b/src/term.c @@ -4751,6 +4751,7 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ FrameCols (tty) = width; FrameRows (tty) = height; 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)); } #endif /* MSDOS */