<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - MSVC does not find strtok_r"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103621#c14">Comment # 14</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - MSVC does not find strtok_r"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103621">bug 103621</a>
from <span class="vcard"><a class="email" href="mailto:jghali@libertysurf.fr" title="Jean Ghali <jghali@libertysurf.fr>"> <span class="fn">Jean Ghali</span></a>
</span></b>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>