From 12776f3d5893732a1e92052e6da226764018303b Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 14 Mar 2008 16:24:52 +0200 Subject: [PATCH] Added autodetecting to appropriate use of silc_va_copy. --- lib/silcutil/silcruntime.h.in | 1 + lib/silcutil/silcutil.h | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/silcutil/silcruntime.h.in b/lib/silcutil/silcruntime.h.in index 80539dab..d0bc898c 100644 --- a/lib/silcutil/silcruntime.h.in +++ b/lib/silcutil/silcruntime.h.in @@ -52,6 +52,7 @@ @__SILC_HAVE_PTHREAD@ @__SILC_ENABLE_DEBUG@ @__SILC_ENABLE_STACKTRACE@ +@__SILC_VA_COPY@ /* Types */ #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@ diff --git a/lib/silcutil/silcutil.h b/lib/silcutil/silcutil.h index 14e6adf5..0b8a4250 100644 --- a/lib/silcutil/silcutil.h +++ b/lib/silcutil/silcutil.h @@ -223,15 +223,7 @@ char *silc_get_real_name(); * each copied list. * ***/ -#if defined(HAVE_VA_COPY) -#define silc_va_copy(dest, src) va_copy(dest, src); -#elif defined(HAVE___VA_COPY) -#define silc_va_copy(dest, src) __va_copy(dest, src); -#elif defined(SILC_VA_COPY_ARRAY) -#define silc_va_copy(dest, src) memmove(dest, src, sizeof(va_list)); -#else -#define silc_va_copy(dest, src) dest = src; -#endif +#define silc_va_copy(dest, src) __SILC_VA_COPY(dest, src) /****f* silcutil/silc_hexdump * @@ -281,4 +273,18 @@ SilcBool silc_hex2data(const char *hex, unsigned char *data, SilcBool silc_data2hex(const unsigned char *data, SilcUInt32 data_len, char *hex, SilcUInt32 hex_size); +/****f* silcutil/silc_get_num_cpu + * + * SYNOPSIS + * + * int silc_get_num_cpu(void); + * + * DESCRIPTION + * + * Returns the number of CPU cores in the current machine. Returns 0 + * if the routine could not determine the number of cores. + * + ***/ +int silc_get_num_cpu(void); + #endif /* !SILCUTIL_H */ -- 2.24.0