From aae966bcc193968e460a4ec4a8163cde6a01f8a3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 6 Sep 2023 20:59:36 +0200 Subject: [PATCH] libtextstyle: Don't export symbols from static MSVC .obj files. * libtextstyle/lib/Makefile.am (config.h): Don't alias isatty to libtextstyle_isatty here, before the Windows header files have been included. * libtextstyle/gnulib-local/lib/isatty.c.diff: New file. * libtextstyle/Makefile.am (EXTRA_DIST): Add it. --- libtextstyle/Makefile.am | 3 ++- libtextstyle/gnulib-local/lib/isatty.c.diff | 15 +++++++++++++++ libtextstyle/lib/Makefile.am | 3 --- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 libtextstyle/gnulib-local/lib/isatty.c.diff diff --git a/libtextstyle/Makefile.am b/libtextstyle/Makefile.am index ca2d03bbb..7544f5280 100644 --- a/libtextstyle/Makefile.am +++ b/libtextstyle/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the toplevel directory of GNU libtextstyle -## Copyright (C) 1995-2022 Free Software Foundation, Inc. +## Copyright (C) 1995-2023 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -55,6 +55,7 @@ EXTRA_DIST = \ gnulib-local/lib/html-styled-ostream.oo.h \ gnulib-local/lib/iconv-ostream.oo.c \ gnulib-local/lib/iconv-ostream.oo.h \ + gnulib-local/lib/isatty.c.diff \ gnulib-local/lib/libcroco/cr-additional-sel.c \ gnulib-local/lib/libcroco/cr-additional-sel.h \ gnulib-local/lib/libcroco/cr-attr-sel.c \ diff --git a/libtextstyle/gnulib-local/lib/isatty.c.diff b/libtextstyle/gnulib-local/lib/isatty.c.diff new file mode 100644 index 000000000..e1133220e --- /dev/null +++ b/libtextstyle/gnulib-local/lib/isatty.c.diff @@ -0,0 +1,15 @@ +*** isatty.c.orig 2023-09-06 17:28:49.893388907 +0200 +--- isatty.c 2023-09-06 17:30:02.718035282 +0200 +*************** +*** 162,167 **** +--- 162,171 ---- + # define _isatty_nothrow _isatty + #endif + ++ #ifdef IN_LIBTEXTSTYLE ++ # define isatty libtextstyle_isatty ++ #endif ++ + /* Determine whether FD refers to a console device. Return 1 if yes. + Return 0 and set errno if no. (ptsname_r relies on the errno value.) */ + int diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am index 324d189db..b0fd3851a 100644 --- a/libtextstyle/lib/Makefile.am +++ b/libtextstyle/lib/Makefile.am @@ -216,9 +216,6 @@ config.h: $(BUILT_SOURCES) libtextstyle.sym echo '#include "../config.h"'; \ echo; \ echo '#endif /* LIBTEXTSTYLE_CONFIG_H */'; \ - case "@host_os@" in \ - mingw* | windows*) echo '#define isatty libtextstyle_isatty' ;; \ - esac; \ } > config.h && \ if test -n "$(NAMESPACING)" && test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \ { \ -- 2.47.3