Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 916071 Details for
Bug 943854
x11-terms/mlterm-3.9.3-r1 - [ncurses-6.5] [meson] [libtool] [gcc-15] bl_map.h: error: assignment to int ( )(char , u_int) {aka int ( )(char , unsigned int)} from incompat
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
attempt to make a C23 patch
mlterm-3.9.3_p20250107-C23.patch (text/plain), 14.88 KB, created by
NHO
on 2025-01-07 16:12:34 UTC
(
hide
)
Description:
attempt to make a C23 patch
Filename:
MIME Type:
Creator:
NHO
Created:
2025-01-07 16:12:34 UTC
Size:
14.88 KB
patch
obsolete
>diff -ru a/baselib/src/bl_map.c b/baselib/src/bl_map.c >--- a/baselib/src/bl_map.c 2025-01-07 17:39:28.359770380 +0400 >+++ b/baselib/src/bl_map.c 2025-01-07 17:43:16.727379998 +0400 >@@ -2,6 +2,7 @@ > > #include "bl_map.h" > >+#include <strings.h> /* strcasecmp */ > #include <string.h> /* strcmp */ > > #include "bl_util.h" /* BL_ARRAY_SIZE */ >diff -ru a/baselib/src/bl_map.h b/baselib/src/bl_map.h >--- a/baselib/src/bl_map.h 2025-01-07 17:39:28.359770380 +0400 >+++ b/baselib/src/bl_map.h 2025-01-07 18:30:52.449783403 +0400 >@@ -114,6 +114,7 @@ > > #endif > >+#if __STDC_VERSION__ <= 201710L > #define bl_map_set(result, map, __key, __value) \ > { \ > int __hash_key; \ >@@ -193,6 +194,87 @@ > __hash_key = bl_map_rehash(__hash_key, (map)->map_size); \ > } \ > } >+#else /* horrors of C23 and macro expansions */ >+#define bl_map_set(result, map, __key, __value) \ >+ { \ >+ int __hash_key; \ >+ u_int __count; \ >+ \ >+ result = 0; \ >+ \ >+ if ((map)->map_size == (map)->filled_size + MAP_MARGIN_SIZE) { \ >+ /* \ >+ * Expanding map by DEFAULT_MAP_SIZE \ >+ */ \ >+ \ >+ u_int __new_size; \ >+ void* __new; \ >+ \ >+ __new_size = (map)->map_size + DEFAULT_MAP_SIZE; \ >+ \ >+ bl_map_dump_size((map)->map_size, __new_size); \ >+ \ >+ if ((__new = calloc(__new_size, sizeof(*(map)->pairs)))) { \ >+ void* __old; \ >+ \ >+ __old = (map)->pairs; \ >+ \ >+ if ((int (*)(int, u_int))(map)->hash_func == bl_map_hash_int || \ >+ (int (*)(int, u_int))(map)->hash_func == bl_map_hash_int_fast) { \ >+ if (__new_size & (__new_size - 1)) { \ >+ /* XXX int (*)() should be int (*)(key_type, u_int) */ \ >+ (map)->hash_func = (typeof((map)->hash_func))bl_map_hash_int; \ >+ } else { \ >+ /* __new_size == 2^n */ \ >+ /* XXX int (*)() should be int (*)(key_type, u_int) */ \ >+ (map)->hash_func = (typeof((map)->hash_func))bl_map_hash_int_fast; \ >+ } \ >+ } \ >+ \ >+ /* reconstruct (map)->pairs since map_size is changed. */ \ >+ for (__count = 0; __count < (map)->map_size; __count++) { \ >+ if ((map)->pairs[__count].is_filled) { \ >+ void *dst; \ >+ \ >+ __hash_key = (*(map)->hash_func)((map)->pairs[__count].key, __new_size); \ >+ \ >+ (map)->pairs = __new; \ >+ while ((map)->pairs[__hash_key].is_filled) { \ >+ __hash_key = bl_map_rehash(__hash_key, __new_size); \ >+ } \ >+ \ >+ dst = &(map)->pairs[__hash_key]; \ >+ (map)->pairs = __old; \ >+ memcpy(dst, &(map)->pairs[__count], sizeof(*(map)->pairs)); \ >+ } \ >+ } \ >+ \ >+ free(__old); \ >+ (map)->pairs = __new; \ >+ (map)->map_size = __new_size; \ >+ } \ >+ } \ >+ \ >+ __hash_key = (*(map)->hash_func)(__key, (map)->map_size); \ >+ for (__count = 0; __count < (map)->map_size; __count++) { \ >+ if (!(map)->pairs[__hash_key].is_filled) { \ >+ (map)->pairs[__hash_key].key = __key; \ >+ (map)->pairs[__hash_key].value = __value; \ >+ (map)->pairs[__hash_key].is_filled = 1; \ >+ (map)->filled_size++; \ >+ \ >+ free((map)->pairs_array); \ >+ (map)->pairs_array = NULL; \ >+ \ >+ result = 1; \ >+ \ >+ break; \ >+ } \ >+ \ >+ __hash_key = bl_map_rehash(__hash_key, (map)->map_size); \ >+ } \ >+ } >+#endif > > #define __bl_map_erase_simple(result, map, __key) \ > int __hash_key; \ >diff -ru a/baselib/src/bl_privilege.c b/baselib/src/bl_privilege.c >--- a/baselib/src/bl_privilege.c 2025-01-07 17:39:28.359770380 +0400 >+++ b/baselib/src/bl_privilege.c 2025-01-07 18:03:12.054945512 +0400 >@@ -1,5 +1,7 @@ > /* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */ > >+#define _POSIX_C_SOURCE 200809L >+ > #include "bl_privilege.h" > > #include <unistd.h> /* getuid/getgid */ >diff -ru a/baselib/src/bl_str.h b/baselib/src/bl_str.h >--- a/baselib/src/bl_str.h 2025-01-07 17:39:28.359770380 +0400 >+++ b/baselib/src/bl_str.h 2025-01-07 18:01:24.941566368 +0400 >@@ -9,8 +9,11 @@ > #include "bl_def.h" > #include "bl_mem.h" /* alloca */ > >-#ifdef HAVE_STRSEP >+#if __STDC_VERSION__ > 201710L /*there's weird problem with strsep imclusion and C23 */ >+#undef HAVE_STRSEP >+#endif > >+#ifdef HAVE_STRSEP > #define bl_str_sep(strp, delim) strsep(strp, delim) > > #else >diff -ru a/common/c_imagelib.c b/common/c_imagelib.c >--- a/common/c_imagelib.c 2025-01-07 17:39:28.360770374 +0400 >+++ b/common/c_imagelib.c 2025-01-07 19:01:40.815602451 +0400 >@@ -2,6 +2,7 @@ > > #ifdef BUILTIN_IMAGELIB > >+#include <strings.h> /* strcasecmp */ > #include <pobl/bl_util.h> /* DIGIT_STR_LEN */ > #include <pobl/bl_mem.h> /* alloca */ > #include <pobl/bl_path.h> /* BL_LIBEXECDIR (for registobmp) */ >diff -ru a/encodefilter/src/ef_xct_conv.c b/encodefilter/src/ef_xct_conv.c >--- a/encodefilter/src/ef_xct_conv.c 2025-01-07 17:39:28.370770313 +0400 >+++ b/encodefilter/src/ef_xct_conv.c 2025-01-07 18:10:03.881399898 +0400 >@@ -2,7 +2,8 @@ > > #include "ef_xct_conv.h" > >-#include <string.h> /* strcasecmp */ >+#include <strings.h> /* strcasecmp */ >+#include <string.h> /* strlen/memcpy */ > #include <pobl/bl_mem.h> > #include <pobl/bl_locale.h> /* bl_get_codeset() */ > #include <pobl/bl_debug.h> >diff -ru a/libind/lex.split.c b/libind/lex.split.c >--- a/libind/lex.split.c 2025-01-07 17:39:28.372770301 +0400 >+++ b/libind/lex.split.c 2025-01-07 18:12:27.251415115 +0400 >@@ -28,6 +28,7 @@ > #define YY_FLEX_MAJOR_VERSION 2 > #define YY_FLEX_MINOR_VERSION 5 > >+#define _GNU_SOURCE /* fileno */ > #include <stdio.h> > > /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ >diff -ru a/uitoolkit/libtype/ui_font_ft.c b/uitoolkit/libtype/ui_font_ft.c >--- a/uitoolkit/libtype/ui_font_ft.c 2025-01-07 17:39:28.377770270 +0400 >+++ b/uitoolkit/libtype/ui_font_ft.c 2025-01-07 18:52:25.395661750 +0400 >@@ -2,6 +2,7 @@ > > #include "../ui_font.h" > >+#include <strings.h> /* strcasecmp */ > #include <stdlib.h> /* strtod */ > #ifdef USE_TYPE_XFT > #include <X11/Xft/Xft.h> >diff -ru a/uitoolkit/ui_emoji.c b/uitoolkit/ui_emoji.c >--- a/uitoolkit/ui_emoji.c 2025-01-07 17:39:28.378770264 +0400 >+++ b/uitoolkit/ui_emoji.c 2025-01-07 19:06:08.585511896 +0400 >@@ -1,5 +1,6 @@ > /* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */ > >+#define _GNU_SOURCE > #include "ui_emoji.h" > > #include <stdio.h> >diff -ru a/uitoolkit/ui_main_config.h b/uitoolkit/ui_main_config.h >--- a/uitoolkit/ui_main_config.h 2025-01-07 17:39:28.379770258 +0400 >+++ b/uitoolkit/ui_main_config.h 2025-01-07 19:00:10.510099861 +0400 >@@ -3,6 +3,7 @@ > #ifndef __UI_MAIN_CONFIG_H__ > #define __UI_MAIN_CONFIG_H__ > >+#define _POSIX_C_SOURCE 200809L > #include <pobl/bl_types.h> > #include <pobl/bl_conf.h> > #include <vt_term.h> >diff -ru a/uitoolkit/ui_picture.c b/uitoolkit/ui_picture.c >--- a/uitoolkit/ui_picture.c 2025-01-07 17:39:28.379770258 +0400 >+++ b/uitoolkit/ui_picture.c 2025-01-07 18:57:26.709002091 +0400 >@@ -8,6 +8,7 @@ > #include <stdlib.h> /* system */ > #include <fcntl.h> > #include <sys/stat.h> >+#include <strings.h> /* strcasecmp */ > > #include <pobl/bl_debug.h> > #include <pobl/bl_str.h> /* strdup */ >diff -ru a/uitoolkit/ui_screen_manager.h b/uitoolkit/ui_screen_manager.h >--- a/uitoolkit/ui_screen_manager.h 2025-01-07 17:39:28.379770258 +0400 >+++ b/uitoolkit/ui_screen_manager.h 2025-01-07 18:56:11.269417619 +0400 >@@ -3,6 +3,8 @@ > #ifndef __UI_SCREEN_MANAGER_H__ > #define __UI_SCREEN_MANAGER_H__ > >+#define _GNU_SOURCE >+#include <stdlib.h> /* putenv */ > #include <stdio.h> /* FILE */ > #include "ui_screen.h" > #include "ui_main_config.h" >diff -ru a/uitoolkit/xlib/ui_decsp_font.h b/uitoolkit/xlib/ui_decsp_font.h >--- a/uitoolkit/xlib/ui_decsp_font.h 2025-01-07 17:39:28.380770252 +0400 >+++ b/uitoolkit/xlib/ui_decsp_font.h 2025-01-07 19:11:29.488887092 +0400 >@@ -3,6 +3,7 @@ > #ifndef __UI_DECSP_FONT_H__ > #define __UI_DECSP_FONT_H__ > >+#include <pobl/bl_def.h> > #include "../ui.h" > > typedef struct ui_decsp_font { >diff -ru a/vtemu/vt_char_encoding.c b/vtemu/vt_char_encoding.c >--- a/vtemu/vt_char_encoding.c 2025-01-07 17:39:28.381770246 +0400 >+++ b/vtemu/vt_char_encoding.c 2025-01-07 18:13:17.842057503 +0400 >@@ -2,6 +2,7 @@ > > #include "vt_char_encoding.h" > >+#include <strings.h> /* strcasecmp */ > #include <stdio.h> /* sscanf */ > > #include <pobl/bl_str.h> /* bl_str_sep */ >diff -ru a/vtemu/vt_config_proto.c b/vtemu/vt_config_proto.c >--- a/vtemu/vt_config_proto.c 2025-01-07 17:39:28.381770246 +0400 >+++ b/vtemu/vt_config_proto.c 2025-01-07 18:49:43.241554908 +0400 >@@ -2,6 +2,7 @@ > > #include "vt_config_proto.h" > >+#define _POSIX_C_SOURCE 200809L /* fileno */ > #include <stdio.h> > #include <stdlib.h> > #include <string.h> >diff -ru a/vtemu/vt_parser.c b/vtemu/vt_parser.c >--- a/vtemu/vt_parser.c 2025-01-07 17:39:28.381770246 +0400 >+++ b/vtemu/vt_parser.c 2025-01-07 18:33:41.858850284 +0400 >@@ -2,7 +2,9 @@ > > #include "vt_parser.h" > >+#define _GNU_SOURCE /* usleep */ > #include <stdio.h> /* sprintf */ >+#include <strings.h> /* strcasecmp */ > #include <string.h> /* memmove */ > #include <stdlib.h> /* atoi */ > #include <fcntl.h> /* open */ >diff -ru a/vtemu/zmodem.c b/vtemu/zmodem.c >--- a/vtemu/zmodem.c 2025-01-07 17:39:28.381770246 +0400 >+++ b/vtemu/zmodem.c 2025-01-07 18:51:05.235103281 +0400 >@@ -47,6 +47,7 @@ > * > */ > >+#define _GNU_SOURCE > #include <stdio.h> > #include <stdarg.h> > #include <assert.h> >diff -ru a/configure b/configure >--- a/configure 2025-01-07 19:48:19.717580180 +0400 >+++ b/configure 2025-01-07 19:54:24.557352944 +0400 >@@ -23781,6 +23781,7 @@ > _ACEOF > if ac_fn_c_try_compile "$LINENO"; then : > $as_echo "#define HAVE_GNU_SOURCE 1" >>confdefs.h >+ $as_echo "#define _GNU_SOURCE" >>confdefs.h > > fi > rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 943854
:
909590
|
909591
|
909592
|
909593
|
909594
|
909595
|
909596
|
909597
|
909598
| 916071