ENH: add a try compile for va_copy
This commit is contained in:
parent
96bf9b372a
commit
beaea73fa0
|
@ -44,6 +44,8 @@ INCLUDE (TryCompileFromSource)
|
||||||
SET(HEADER_INCLUDES "${CURRENT_INCLUDES}")
|
SET(HEADER_INCLUDES "${CURRENT_INCLUDES}")
|
||||||
TRY_COMPILE_FROM_SOURCE("va_list list1, list2; list1 = list2"
|
TRY_COMPILE_FROM_SOURCE("va_list list1, list2; list1 = list2"
|
||||||
VA_LIST_ISNOT_ARRAY_DEFINE)
|
VA_LIST_ISNOT_ARRAY_DEFINE)
|
||||||
|
TRY_COMPILE_FROM_SOURCE("va_list list1, list2; va_copy(list1, list2);"
|
||||||
|
HAS_VA_COPY)
|
||||||
SET(VA_LIST_IS_ARRAY_DEFINE 0)
|
SET(VA_LIST_IS_ARRAY_DEFINE 0)
|
||||||
IF(NOT VA_LIST_ISNOT_ARRAY_DEFINE)
|
IF(NOT VA_LIST_ISNOT_ARRAY_DEFINE)
|
||||||
SET(VA_LIST_IS_ARRAY_DEFINE 1)
|
SET(VA_LIST_IS_ARRAY_DEFINE 1)
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#define VA_LIST_IS_ARRAY @VA_LIST_IS_ARRAY_DEFINE@
|
#define VA_LIST_IS_ARRAY @VA_LIST_IS_ARRAY_DEFINE@
|
||||||
|
|
||||||
|
#cmakedefine HAS_VA_COPY @HAS_VA_COPY@
|
||||||
|
|
||||||
#define HAVE_LIBWWW_SSL @HAVE_LIBWWW_SSL_DEFINE@
|
#define HAVE_LIBWWW_SSL @HAVE_LIBWWW_SSL_DEFINE@
|
||||||
|
|
||||||
#define ATTR_UNUSED @ATTR_UNUSED@
|
#define ATTR_UNUSED @ATTR_UNUSED@
|
||||||
|
|
|
@ -24,10 +24,14 @@ typedef double va_double;
|
||||||
** tricky fashions. We don't why Python does this, but since we're
|
** tricky fashions. We don't why Python does this, but since we're
|
||||||
** abusing our va_list objects in a similar fashion, we'll copy them
|
** abusing our va_list objects in a similar fashion, we'll copy them
|
||||||
** too. */
|
** too. */
|
||||||
#if VA_LIST_IS_ARRAY
|
#ifdef HAS_VA_COPY
|
||||||
#define VA_LIST_COPY(dest,src) memcpy((dest), (src), sizeof(va_list))
|
# define VA_LIST_COPY(dest,src) va_copy((dest), (src))
|
||||||
#else
|
#else
|
||||||
#define VA_LIST_COPY(dest,src) ((dest) = (src))
|
# if VA_LIST_IS_ARRAY
|
||||||
|
# define VA_LIST_COPY(dest,src) memcpy((dest), (src), sizeof(va_list))
|
||||||
|
# else
|
||||||
|
# define VA_LIST_COPY(dest,src) ((dest) = (src))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue