From: Bruno Haible Date: Thu, 5 Jun 2025 19:37:04 +0000 (+0200) Subject: build: Fix some crashes when building with --enable-shared on MSVC. X-Git-Tag: v0.25.1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38b2844f1cba84fe1e28f1be56e2ae4bba3d1175;p=thirdparty%2Fgettext.git build: Fix some crashes when building with --enable-shared on MSVC. Reported by Kirill Makurin in . * gnulib-local/lib/gl_carray_list.h.diff: New file. * gnulib-local/lib/gl_hash_map.h.diff: New file. * gnulib-local/lib/gl_hash_set.h.diff: New file. * gnulib-local/Makefile.am (EXTRA_DIST): Add them. --- diff --git a/gettext-tools/woe32dll/gettextlib-exports.c b/gettext-tools/woe32dll/gettextlib-exports.c index 1330fc76f..8fc2ab631 100644 --- a/gettext-tools/woe32dll/gettextlib-exports.c +++ b/gettext-tools/woe32dll/gettextlib-exports.c @@ -31,6 +31,9 @@ VARIABLE(error_print_progname) #endif VARIABLE(error_with_progname) VARIABLE(exit_failure) +VARIABLE(gl_carray_list_implementation) +VARIABLE(gl_hash_map_implementation) +VARIABLE(gl_hash_set_implementation) VARIABLE(gl_linkedhash_list_implementation) VARIABLE(program_name) #if GNULIB_DEFINED_GETOPT diff --git a/gnulib-local/Makefile.am b/gnulib-local/Makefile.am index 71a5d260c..852774428 100644 --- a/gnulib-local/Makefile.am +++ b/gnulib-local/Makefile.am @@ -34,6 +34,9 @@ lib/getlocalename_l-unsafe.c.diff \ lib/getopt-core.h.diff \ lib/gettext.h \ lib/gl_array_list.h.diff \ +lib/gl_carray_list.h.diff \ +lib/gl_hash_map.h.diff \ +lib/gl_hash_set.h.diff \ lib/gl_linkedhash_list.h.diff \ lib/libxml/buf.c \ lib/libxml/buf.h \ diff --git a/gnulib-local/lib/gl_carray_list.h.diff b/gnulib-local/lib/gl_carray_list.h.diff new file mode 100644 index 000000000..fd8f10d54 --- /dev/null +++ b/gnulib-local/lib/gl_carray_list.h.diff @@ -0,0 +1,19 @@ +*** gl_carray_list.h.orig +--- gl_carray_list.h +*************** +*** 24,30 **** + extern "C" { + #endif + +! extern const struct gl_list_implementation gl_carray_list_implementation; + #define GL_CARRAY_LIST &gl_carray_list_implementation + + #ifdef __cplusplus +--- 24,30 ---- + extern "C" { + #endif + +! extern DLL_VARIABLE const struct gl_list_implementation gl_carray_list_implementation; + #define GL_CARRAY_LIST &gl_carray_list_implementation + + #ifdef __cplusplus diff --git a/gnulib-local/lib/gl_hash_map.h.diff b/gnulib-local/lib/gl_hash_map.h.diff new file mode 100644 index 000000000..f7c6b82bc --- /dev/null +++ b/gnulib-local/lib/gl_hash_map.h.diff @@ -0,0 +1,19 @@ +*** gl_hash_map.h.orig +--- gl_hash_map.h +*************** +*** 24,30 **** + extern "C" { + #endif + +! extern const struct gl_map_implementation gl_hash_map_implementation; + #define GL_HASH_MAP &gl_hash_map_implementation + + #ifdef __cplusplus +--- 24,30 ---- + extern "C" { + #endif + +! extern DLL_VARIABLE const struct gl_map_implementation gl_hash_map_implementation; + #define GL_HASH_MAP &gl_hash_map_implementation + + #ifdef __cplusplus diff --git a/gnulib-local/lib/gl_hash_set.h.diff b/gnulib-local/lib/gl_hash_set.h.diff new file mode 100644 index 000000000..14b178fdc --- /dev/null +++ b/gnulib-local/lib/gl_hash_set.h.diff @@ -0,0 +1,19 @@ +*** gl_hash_set.h.orig +--- gl_hash_set.h +*************** +*** 24,30 **** + extern "C" { + #endif + +! extern const struct gl_set_implementation gl_hash_set_implementation; + #define GL_HASH_SET &gl_hash_set_implementation + + #ifdef __cplusplus +--- 24,30 ---- + extern "C" { + #endif + +! extern DLL_VARIABLE const struct gl_set_implementation gl_hash_set_implementation; + #define GL_HASH_SET &gl_hash_set_implementation + + #ifdef __cplusplus