[ https://issues.apache.org/jira/browse/XERCESC-2194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17052212#comment-17052212 ]
Rasmus Thomsen edited comment on XERCESC-2194 at 3/5/20, 2:58 PM: ------------------------------------------------------------------ According to [the CMake docs|https://cmake.org/cmake/help/v3.17/module/CheckTypeSize.html?highlight=i] it might be a better idea to use {code}HAVE_${TYPE}{code} in XercesIntTypes.cmake instead of SIZEOF_SSIZE_T to determine if it's available: {code} -if(SIZEOF_SIZE_T) +if(HAVE_SIZEOF_OFF_T) set(XERCES_SIZE_T size_t) set(XERCES_SIZE_MAX SIZE_MAX) else() set(XERCES_SIZE_T "unsigned long") set(XERCES_SIZE_MAX ULONG_MAX) endif() -if(SIZEOF_SSIZE_T) +if(HAVE_ssize_t) set(XERCES_SSIZE_T SIZEOF_SSIZE_T) set(XERCES_SSIZE_MAX SSIZE_MAX) else() set(XERCES_SSIZE_T long) set(XERCES_SSIZE_MAX LONG_MAX) endif() {code} Or something along those lines? was (Author: cogitri): According to [the CMake docs|https://cmake.org/cmake/help/v3.17/module/CheckTypeSize.html?highlight=i] it might be a better idea to use {code}HAVE_${TYPE}{code} in XercesIntTypes.cmake instead of SIZEOF_SSIZE_T to determine if it's available: {code:diff} -if(SIZEOF_SIZE_T) +if(HAVE_SIZEOF_OFF_T) set(XERCES_SIZE_T size_t) set(XERCES_SIZE_MAX SIZE_MAX) else() set(XERCES_SIZE_T "unsigned long") set(XERCES_SIZE_MAX ULONG_MAX) endif() -if(SIZEOF_SSIZE_T) +if(HAVE_ssize_t) set(XERCES_SSIZE_T SIZEOF_SSIZE_T) set(XERCES_SSIZE_MAX SSIZE_MAX) else() set(XERCES_SSIZE_T long) set(XERCES_SSIZE_MAX LONG_MAX) endif() {code} Or something along those lines? > Including Xerces_autoconf_config.hpp on Windows fails due to undefined ssize_t > ------------------------------------------------------------------------------ > > Key: XERCESC-2194 > URL: https://issues.apache.org/jira/browse/XERCESC-2194 > Project: Xerces-C++ > Issue Type: Bug > Components: Build > Affects Versions: 3.2.2 > Reporter: Rasmus Thomsen > Priority: Major > > When including Xerces_autoconf_config.hpp on Windows the following error > messages: > > {code:cpp} > error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: > "default-int" wird von C++ nicht unterstützt. > error C2146: Syntaxfehler: Fehlendes ";" vor Bezeichner "XMLSSize_t" > {code} > (Sorry that these are in German - they translate to "Missing type specifier - > assuming int" and "syntax error: missing ";" before identifier "XMLSSize_t") > Apparently ssize_t is a POSIX extension and as such isn't available in MSVC > (by default?) -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org