bug-gnulib
[Top][All Lists]
Advanced

[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: Sun, 06 Dec 2020 16:48:53 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-193-generic; KDE/5.18.0; x86_64; ; )

Daniel R. Hurtmans wrote:
> undefined reference to `std::basic_ifstream<char, std::char_traits<char> 
>  >::_close()'

Oh, so the OpenMP #pragma is not the only problem. It potentially affects
all of the symbols that are #defined.

I'm committing the attached two patches. The idea is to not use #defines
for redirecting functions in C++ mode, when GNULIB_NAMESPACE is defined.

With these patches, you should be able to revert the workaround that I
suggested earlier. But you need to define GNULIB_NAMESPACE.


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

        Do the Windows oldnames workaround through the C++ GNULIB_NAMESPACE.
        Reported by Daniel R. Hurtmans <Daniel.Hurtmans@ulb.ac.be> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00029.html>.
        * lib/c++defs.h (_GL_CXXALIAS_MDA_CAST): New macro.
        * 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.
        * lib/search.in.h (lfind, lsearch): Likewise.
        * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
        Likewise.
        * 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/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FCLOSEALL.
        (gl_STDIO_H): Set HAVE_DECL_FCLOSEALL.
        * modules/stdio (Makefile.am): Substitute HAVE_DECL_FCLOSEALL.
        * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_ECVT,
        HAVE_DECL_FCVT, HAVE_DECL_GCVT.
        (gl_STDLIB_H): Set HAVE_DECL_ECVT, HAVE_DECL_FCVT, HAVE_DECL_GCVT.
        * modules/stdlib (Makefile.am): Substitute HAVE_DECL_ECVT,
        HAVE_DECL_FCVT, HAVE_DECL_GCVT.
        * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_EXECVPE.
        (gl_UNISTD_H): Set HAVE_DECL_EXECVPE.
        * modules/unistd (Makefile.am): Substitute HAVE_DECL_EXECVPE.
        * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_DECL_WCSDUP.
        (gl_WCHAR_H): Set HAVE_DECL_WCSDUP.
        * modules/wchar (Makefile.am): Substitute HAVE_DECL_WCSDUP.

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

        doc: Mention some missing function declarations.
        * doc/glibc-functions/execvpe.texi: Mention the missing declaration on
        AIX.
        * doc/glibc-functions/fcloseall.texi: Mention the missing declaration on
        FreeBSD.
        * doc/pastposix-functions/ecvt.texi: Mention the missing declaration on
        Cygwin.
        * doc/pastposix-functions/fcvt.texi: Likewise.
        * doc/pastposix-functions/gcvt.texi: Likewise.

Attachment: 0001-doc-Mention-some-missing-function-declarations.patch
Description: Text Data

Attachment: 0002-Do-the-Windows-oldnames-workaround-through-the-C-GNU.patch
Description: Text Data


reply via email to

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