Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XERCESC-2208: Use cstdint and standard integer types #21

Merged
merged 5 commits into from Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -105,7 +105,6 @@ include(XercesWarnings)
include(XercesIncludes)
include(XercesFunctions)
include(XercesDLL)
include(XercesIntTypes)
include(XercesPathDelimiters)
include(XercesICU)
include(XercesMutexMgrSelection)
Expand Down
162 changes: 0 additions & 162 deletions cmake/XercesIntTypes.cmake

This file was deleted.

3 changes: 1 addition & 2 deletions cmake/XercesXMLCh.cmake
Expand Up @@ -24,7 +24,6 @@

include(CheckCXXSourceCompiles)
include(CheckTypeSize)
include(XercesIntTypes)

check_cxx_source_compiles("
int main() {
Expand Down Expand Up @@ -74,7 +73,7 @@ if(xmlch_type_found EQUAL -1)
message(FATAL_ERROR "${xmlch_type} xmlch_type unavailable")
endif()

set(XERCES_XMLCH_T ${XERCES_U16BIT_INT})
set(XERCES_XMLCH_T uint16_t)
set(XERCES_USE_CHAR16_T 0)
set(XERCES_INCLUDE_WCHAR_H 0)
if(xmlch_type STREQUAL "char16_t")
Expand Down
68 changes: 0 additions & 68 deletions config.h.cmake.in
@@ -1,20 +1,6 @@
/* config.h.cmake.in. Not generated, but originated from autoheader. */
/* This file must be kept up-to-date with needed substitutions from config.h.in. */

/* Define to 1 if you have the <cstdint> header file. */
#cmakedefine HAVE_CSTDINT 1

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1

#if defined(__cplusplus) && defined(HAVE_CSTDINT)
#include <cstdint>
#elif HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif

/* Define to specify no threading is used */
#cmakedefine APP_NO_THREADS 1

Expand Down Expand Up @@ -93,9 +79,6 @@
/* Define to 1 if you have the `iconv_open' function. */
#cmakedefine HAVE_ICONV_OPEN 1

/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1

/* Define to 1 if you have the <langinfo.h> header file. */
#cmakedefine HAVE_LANGINFO_H 1

Expand Down Expand Up @@ -292,24 +275,6 @@
/* Define to the version of this package. */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT @SIZEOF_INT@

/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG @SIZEOF_LONG@

/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@

/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT @SIZEOF_SHORT@

/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T @SIZEOF_WCHAR_T@

/* The size of `__int64', as computed by sizeof. */
#define SIZEOF___INT64 @SIZEOF___INT64@

/* Version number of package */
#define VERSION "@PACKAGE_VERSION@"

Expand All @@ -330,9 +295,6 @@
/* Define to 1 if you have intrin.h */
#cmakedefine XERCES_HAVE_INTRIN_H 1

/* Define to 1 if we have inttypes.h */
#cmakedefine XERCES_HAVE_INTTYPES_H 1

/* Define to have SSE2 instruction used at runtime */
#cmakedefine XERCES_HAVE_SSE2_INTRINSIC 1

Expand All @@ -354,39 +316,9 @@
/* Define as the platform's import attribute */
#define XERCES_PLATFORM_IMPORT @XERCES_PLATFORM_IMPORT@

/* An appropriate signed 16 bit integer type */
#define XERCES_S16BIT_INT @XERCES_S16BIT_INT@

/* An appropriate signed 32 bit integer type */
#define XERCES_S32BIT_INT @XERCES_S32BIT_INT@

/* An appropriate signed 64 bit integer type */
#define XERCES_S64BIT_INT @XERCES_S64BIT_INT@

/* Define as the appropriate SIZE_MAX macro */
#define XERCES_SIZE_MAX @XERCES_SIZE_MAX@

/* Define as the appropriate size_t type */
#define XERCES_SIZE_T @XERCES_SIZE_T@

/* Define as the appropriate SSIZE_MAX macro */
#define XERCES_SSIZE_MAX @XERCES_SSIZE_MAX@

/* Define as the appropriate ssize_t type */
#define XERCES_SSIZE_T @XERCES_SSIZE_T@

/* Define if building a static library */
#cmakedefine XERCES_STATIC_LIBRARY 1

/* An appropriate unsigned 16 bit integer type */
#define XERCES_U16BIT_INT @XERCES_U16BIT_INT@

/* An appropriate unsigned 32 bit integer type */
#define XERCES_U32BIT_INT @XERCES_U32BIT_INT@

/* An appropriate unsigned 64 bit integer type */
#define XERCES_U64BIT_INT @XERCES_U64BIT_INT@

/* Define to use the POSIX file mgr */
#cmakedefine XERCES_USE_FILEMGR_POSIX 1

Expand Down
47 changes: 2 additions & 45 deletions configure.ac
Expand Up @@ -137,8 +137,8 @@ AC_SUBST([BUILD_STATIC], [$enable_static])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h langinfo.h limits.h locale.h \
memory.h netdb.h netinet/in.h nl_types.h stddef.h stdint.h \
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h langinfo.h limits.h locale.h \
memory.h netdb.h netinet/in.h nl_types.h stddef.h \
sys/param.h sys/socket.h sys/time.h sys/timeb.h \
unistd.h wchar.h wctype.h \
CoreServices/CoreServices.h \
Expand All @@ -149,13 +149,6 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h langinfo.h limits.h loc
AC_HEADER_STDBOOL

AC_CHECK_SIZEOF(wchar_t)
AC_CHECK_TYPE(size_t)
AC_CHECK_TYPE(ssize_t)

AC_TYPE_OFF_T
AC_TYPE_SIZE_T

XERCES_INT_TYPES

ACX_PTHREAD

Expand Down Expand Up @@ -189,24 +182,6 @@ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <limits.h>]],
]
)

# Check for functional cstdint header
AC_MSG_CHECKING([for cstdint])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cstdint>]],
[[
uint32_t v1 = 342;
int64_t v2 = -23;
return 0;
]])],
[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([XERCES_HAVE_CSTDINT], 1, [Define to 1 if cstdint is functional.])
],
[
AC_MSG_RESULT([no])
AC_DEFINE_UNQUOTED([XERCES_HAVE_CSTDINT], 0, [Define to 1 if cstdint is functional.])
]
)

# The check for mbrlen, wcsrtombs and mbsrtowcs gives a false
# positive on HP-UX, so we use a different snippet to set the
# corresponding macro
Expand Down Expand Up @@ -336,14 +311,8 @@ AC_ARG_ENABLE(sse2,
# publicly visible Xerces_autoconf_config.h file.
######################################################

AC_DEFINE([XERCES_AUTOCONF], 1, [Define to true if autoconf is used in this configuration])

AS_IF([test x$ac_cv_header_stdint_h = xyes],
AC_DEFINE([XERCES_HAVE_STDINT_H], 1, [Define to 1 if we have stdint.h]))
AS_IF([test x$ac_cv_header_sys_types_h = xyes],
AC_DEFINE([XERCES_HAVE_SYS_TYPES_H], 1, [Define to 1 if we have sys/types.h]))
AS_IF([test x$ac_cv_header_inttypes_h = xyes],
AC_DEFINE([XERCES_HAVE_INTTYPES_H], 1, [Define to 1 if we have inttypes.h]))

case $host in
*-*-msdos* | *-*-mingw32* | *-*-cygwin* | *-*-windows* )
Expand Down Expand Up @@ -486,18 +455,6 @@ if test "$have_sse2" = "yes"; then
fi
fi

AS_IF([test x$ac_cv_type_size_t = xyes],
AC_DEFINE([XERCES_SIZE_T], [size_t], [Define as the appropriate size_t type])
AC_DEFINE([XERCES_SIZE_MAX], [SIZE_MAX], [Define as the appropriate SIZE_MAX macro]),
AC_DEFINE([XERCES_SIZE_T], [unsigned long], [Define as the appropriate size_t type])
AC_DEFINE([XERCES_SIZE_MAX], [ULONG_MAX], [Define as the appropriate SIZE_MAX macro]))

AS_IF([test x$ac_cv_type_ssize_t = xyes],
AC_DEFINE([XERCES_SSIZE_T], [ssize_t], [Define as the appropriate ssize_t type])
AC_DEFINE([XERCES_SSIZE_MAX], [SSIZE_MAX], [Define as the appropriate SSIZE_MAX macro]),
AC_DEFINE([XERCES_SSIZE_T], [long], [Define as the appropriate ssize_t type])
AC_DEFINE([XERCES_SSIZE_MAX], [LONG_MAX], [Define as the appropriate SSIZE_MAX macro]))

AC_OUTPUT

AC_MSG_NOTICE
Expand Down