[Poppler-bugs] [Bug 103621] MSVC does not find strtok_r

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Nov 18 00:05:04 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=103621

--- Comment #14 from Jean Ghali <jghali at libertysurf.fr> ---
If everything in poppler is C++, then the extern "C" stuff in goo/glibc.h is
unneeded in the first place.

If glibc.h is kept as is, and assuming glibc*.cc files are compiled as C++,
then the extern "C" stuff is required in glibc.cc and glibc_strtok_r.cc so that
the function name mangling be consistent between the functions declaration and
the implementation. Otherwise a function funcName(...) declared inside an
extern "C" and a function funcName(...) implemented outside an extern "C" are
just two different functions for the C++ compiler and linker. Adding
__cplusplus guards in glibc*.cc files ensures that the function name mangling
is consistent between the declaration and implementation whether those files
are compiled as C or C++.

In the end, the first decision to take is whether glibc*.cc files continue to
be compiled as C++ or if they should be compiled as C, in which case it is
better to rename those files as *.c.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20171118/a85a0fc9/attachment-0001.html>


More information about the Poppler-bugs mailing list