You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Scott Cantor (JIRA)" <xe...@xml.apache.org> on 2017/07/11 19:09:00 UTC

[jira] [Closed] (XERCESC-1917) GCCDefs str[n]icmp prototype and symbol exposure

     [ https://issues.apache.org/jira/browse/XERCESC-1917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Cantor closed XERCESC-1917.
---------------------------------

> 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 was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org