>From b7a2ae4b63814d0bd6a95212a0e3f487710b6007 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 15 Oct 2023 12:36:57 +0200 Subject: [PATCH 3/8] MSVC port, part 3: Support compilers other than GCC. * info/pcterm.c (w32_info_init): Make non-static. If !__GNUC__, don't use __attribute__((constructor)). * info/info.c (main) [!__GNUC__]: Invoke w32_info_init from here. --- info/info.c | 5 +++++ info/pcterm.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/info/info.c b/info/info.c index 8ca4a17e58..3ab0126a27 100644 --- a/info/info.c +++ b/info/info.c @@ -690,6 +690,11 @@ main (int argc, char *argv[]) char *init_file = 0; /* Name of init file specified. */ char *error = 0; /* Error message to display in mini-buffer. */ +#if defined (_WIN32) && !defined (__GNUC__) + extern void w32_info_init (void); + w32_info_init (); +#endif + #ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); diff --git a/info/pcterm.c b/info/pcterm.c index a48478d29d..77ff6ffd06 100644 --- a/info/pcterm.c +++ b/info/pcterm.c @@ -162,10 +162,12 @@ w32_cleanup (void) } } -static void w32_info_init (void) __attribute__((constructor)); +#if defined (__GNUC__) +void w32_info_init (void) __attribute__((constructor)); +#endif static void pc_initialize_terminal (char *); -static void +void w32_info_init (void) { /* We need to set this single hook here; the rest -- 2.34.1