mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
cmake: Fix detection of ssize_t/SSIZE_T
Since ssize_it is POSIX, windows/VS also have this but with BaseTsd.h, plus the logic prefers "ssize_t" (lower) instead of "SSIZE_T" (upper) when the latest only available -- fix this too. Refs: #311
This commit is contained in:
parent
5b58b709b2
commit
7707f6b03a
@ -420,21 +420,19 @@ CHECK_TYPE_SIZE("off_t" EVENT__SIZEOF_OFF_T LANGUAGE C)
|
|||||||
# XXX we should functionalize these size and type sets. --elley
|
# XXX we should functionalize these size and type sets. --elley
|
||||||
|
|
||||||
# Winssck.
|
# Winssck.
|
||||||
set(SSIZE_TMAP_ssize_t "ssize_t")
|
if (_MSC_VER)
|
||||||
set(SSIZE_TMAP_SSIZE_T "SSIZE_T")
|
list(APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h)
|
||||||
|
endif()
|
||||||
|
CHECK_TYPE_SIZE("ssize_t" EVENT__SIZEOF_SSIZE_T_LOWER LANGUAGE C)
|
||||||
|
CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C)
|
||||||
|
|
||||||
CHECK_TYPE_SIZE("ssize_t" EVENT__SIZEOF_SSIZE_T LANGUAGE C)
|
if (EVENT__SIZEOF_SSIZE_T_LOWER)
|
||||||
CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T LANGUAGE C)
|
|
||||||
|
|
||||||
if (DEFINED EVENT__SIZEOF_SSIZE_T)
|
|
||||||
if (DEFINED SSIZE_TMAP_ssize_t)
|
|
||||||
set(EVENT__ssize_t "ssize_t")
|
set(EVENT__ssize_t "ssize_t")
|
||||||
elseif (DEFINED SSIZE_TMAP_SSIZE_T)
|
elseif (EVENT__SIZEOF_SSIZE_T_UPPER)
|
||||||
set(EVENT__ssize_t "SSIZE_T")
|
set(EVENT__ssize_t "SSIZE_T")
|
||||||
else()
|
else()
|
||||||
set(EVENT__ssize_t "int")
|
set(EVENT__ssize_t "int")
|
||||||
set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
|
set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user