[ https://issues.apache.org/jira/browse/XERCESC-1917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Boris Kolpackov updated XERCESC-1917: ------------------------------------- Priority: Minor (was: Major) Issue Type: Improvement (was: Bug) FYI, there are no plans to release any more versions in the 2-series. In the 3-series we use a similar workaround but in a cross-platform way, so this patch is not easily applicable. Also, what is the problem with having these symbols visible in the Xerces-C++ library? > GCCDefs str[n]icmp prototype and symbol exposure > ------------------------------------------------ > > Key: XERCESC-1917 > URL: https://issues.apache.org/jira/browse/XERCESC-1917 > Project: Xerces-C++ > Issue Type: Improvement > Components: Build > Affects Versions: 2.8.0 > Environment: linux x86_64 gcc > Reporter: George Gensure > Priority: Minor > > The stricmp and strnicmp prototypes provided as a workaround for those > functions missing in gcc/glibc installations are defined in the global scope > and without extern "C" qualifiers. As a result, these are the *only* > non-xerces_2_8 namespaced functions exposed by the shared library on linux. > I recognize that the compiler workarounds are included prior to the xercesc > namespace definition, and as a compromise I'd be happy to see the definitions > have their prototypes changed to be within an extern "C" block, as well as > __attribute__((visibility("hidden"))) applied to their definitions. The > following diff applies cleanly to the 2.8 release and corrects my problem: > --- src/xercesc/util/Compilers/GCCDefs.hpp > +++ src/xercesc/util/Compilers/GCCDefs.hpp > @@ -130,8 +130,10 @@ > #if !defined(__CYGWIN__) && !defined(__MINGW32__) > +extern "C" { > int stricmp(const char* const str1, const char* const str2); > int strnicmp(const char* const str1, const char* const str2, const unsigned > int count); > +} > #endif // ! __CYGWIN__ > --- src/xercesc/util/Compilers/GCCDefs.cpp > +++ src/xercesc/util/Compilers/GCCDefs.cpp > @@ -33,11 +33,13 @@ > #if !defined(__CYGWIN__) && !defined(__MINGW32__) > +__attribute__((visibility("hidden"))) > int stricmp(const char* const str1, const char* const str2) > { > return strcasecmp(str1, str2); > } > +__attribute__((visibility("hidden"))) > int strnicmp(const char* const str1, const char* const str2, const unsigned > int count) > { > if (count == 0) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org