From: Brad King Date: Wed, 11 Nov 2009 14:20:14 +0000 (-0500) Subject: Fix size_t and ssize_t defaults on Borland X-Git-Tag: v2.8.0~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f0abf092e6fd50c251cc4d14317585bf81a6a9;p=thirdparty%2Flibarchive.git Fix size_t and ssize_t defaults on Borland We use more generic decision tests to select these types. The new tests choose the proper types for Borland while preserving reasonable defaults for other compilers. SVN-Revision: 1641 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ea50289d5..3a08bb08e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,20 +527,20 @@ ENDIF(NOT HAVE_OFF_T) # CHECK_TYPE_SIZE(size_t SIZE_T) IF(NOT HAVE_SIZE_T) - SET(size_t "unsigned int") + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + SET(size_t "uint64_t") + ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + SET(size_t "uint32_t") + ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) ENDIF(NOT HAVE_SIZE_T) # CHECK_TYPE_SIZE(ssize_t SSIZE_T) IF(NOT HAVE_SSIZE_T) - IF(MSVC) - IF(CMAKE_CL_64) - SET(ssize_t "__int64") - ELSE(CMAKE_CL_64) - SET(ssize_t "signed long") - ENDIF(CMAKE_CL_64) - ELSE(MSVC) - SET(ssize_t "int") - ENDIF(MSVC) + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + SET(ssize_t "int64_t") + ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + SET(ssize_t "long") + ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) ENDIF(NOT HAVE_SSIZE_T) # CHECK_TYPE_SIZE(uid_t UID_T) diff --git a/libarchive/archive.h b/libarchive/archive.h index 1942188f2..6bd1b34b2 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -52,7 +52,9 @@ /* These should match the types used in 'struct stat' */ #if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 -# if defined(_WIN64) +# if defined(_SSIZE_T_DEFINED) +# define __LA_SSIZE_T ssize_t +# elif defined(_WIN64) # define __LA_SSIZE_T __int64 # else # define __LA_SSIZE_T long