[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ and read redefinition

From: Bruno Haible
Subject: Re: C++ and read redefinition
Date: Fri, 25 Dec 2020 16:22:35 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

On 2020-12-06 I committed this:

>       * lib/fcntl.in.h (creat, open):  In C++ mode, when GNULIB_NAMESPACE is
>       defined: 1. Define a symbol in this namespace. 2. Don't redirect using
>       a preprocessor #define.
>       * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise.
>       ...

There are other situations when it is necessary to avoid preprocessor
#defines. For example, when building libtextstyle on native Windows,
the package intentionally does
  #define isatty libtextstyle_isatty
and when <unistd.h> does
  #undef isatty
  #define isatty _isatty
the library defines a wrong symbol, leading to a link error.

So, what we need is a way through which a package can avoid some or
all of these preprocessor #defines. Done as follows:

2020-12-25  Bruno Haible  <bruno@clisp.org>

        Make it possible to turn off each of the Windows oldnames workarounds.
        * lib/fcntl.in.h (creat, open):  Conditionalize each of the Windows
        oldnames workarounds through a GNULIB_MDA_<func> symbol.
        * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise.
        * lib/search.in.h (lfind, lsearch): Likewise.
        * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
        * lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise.
        * lib/string.in.h (memccpy, strdup): Likewise.
        * lib/sys_stat.in.h (chmod, umask): Likewise.
        * lib/time.in.h (tzset): Likewise.
        * lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle,
        execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek,
        read, rmdir, swab, unlink, write): Likewise.
        * lib/utime.in.h (utime): Likewise.
        * lib/wchar.in.h (wcsdup): Likewise.
        * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these
        GNULIB_MDA_<func> symbols.
        * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise.
        * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise.
        * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
        * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise.
        * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise.
        * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
        * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise.
        * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
        * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise.
        * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise.
        * modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func>
        * modules/math (Makefile.am): Likewise.
        * modules/search (Makefile.am): Likewise.
        * modules/stdio (Makefile.am): Likewise.
        * modules/stdlib (Makefile.am): Likewise.
        * modules/string (Makefile.am): Likewise.
        * modules/sys_stat (Makefile.am): Likewise.
        * modules/time (Makefile.am): Likewise.
        * modules/unistd (Makefile.am): Likewise.
        * modules/utime-h (Makefile.am): Likewise.
        * modules/wchar (Makefile.am): Likewise.

Attachment: 0001-Make-it-possible-to-turn-off-each-of-the-Windows-old.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]