From: Bruno Haible Date: Thu, 14 Mar 2019 23:02:55 +0000 (+0100) Subject: libtextstyle: Reexport isatty() override from gnulib. X-Git-Tag: v0.20~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66b766ae149bbdcaebce0606322fa2155704b159;p=thirdparty%2Fgettext.git libtextstyle: Reexport isatty() override from gnulib. This is necessary for programs that are compiled for native Windows and run in a Cygwin console. * libtextstyle/autogen.sh (GNULIB_MODULES): Add 'isatty'. * libtextstyle/configure.ac: Set GNULIB_ISATTY to 0. * libtextstyle/lib/textstyle.h (libtextstyle_isatty): New declaration. (isatty): Redirect to libtextstyle_isatty. --- diff --git a/libtextstyle/.gitignore b/libtextstyle/.gitignore index fc3180842..c2b2a29a9 100644 --- a/libtextstyle/.gitignore +++ b/libtextstyle/.gitignore @@ -81,6 +81,7 @@ /lib/iconv-ostream.oo.c /lib/iconv-ostream.oo.h /lib/intprops.h +/lib/isatty.c /lib/isinf.c /lib/isnan.c /lib/isnand.c diff --git a/libtextstyle/autogen.sh b/libtextstyle/autogen.sh index 8fbe8d05f..d1980dfc4 100755 --- a/libtextstyle/autogen.sh +++ b/libtextstyle/autogen.sh @@ -84,6 +84,7 @@ if test $skip_gnulib = false; then html-styled-ostream term-styled-ostream filename + isatty xalloc xconcat-filename diff --git a/libtextstyle/configure.ac b/libtextstyle/configure.ac index 922634053..13c79fee8 100644 --- a/libtextstyle/configure.ac +++ b/libtextstyle/configure.ac @@ -70,6 +70,10 @@ dnl Checks for types, header files, functions and declarations. gl_INIT +dnl Arrange that the gnulib-generated does not declare isatty(). The +dnl adhoc-tests want to get this declaration from , not . +GNULIB_ISATTY=0 + dnl Compilation on mingw and Cygwin needs special Makefile rules, because dnl 1. when we install a shared library, we must arrange to export dnl auxiliary pointer variables for every exported variable, diff --git a/libtextstyle/lib/textstyle.h b/libtextstyle/lib/textstyle.h index f905fe6cc..6f3d0de04 100644 --- a/libtextstyle/lib/textstyle.h +++ b/libtextstyle/lib/textstyle.h @@ -530,6 +530,26 @@ extern void libtextstyle_set_failure_exit_code (int exit_code); } #endif +/* ----------------------- Exported gnulib overrides ----------------------- */ + +#if defined _WIN32 && ! defined __CYGWIN__ + +# include + +# ifdef __cplusplus +extern "C" { +# endif + +extern int libtextstyle_isatty (int fd); +# undef isatty +# define isatty libtextstyle_isatty + +# ifdef __cplusplus +} +# endif + +#endif + /* ------------------------------------------------------------------------- */ #endif /* _TEXTSTYLE_H */