Added autodetecting to appropriate use of silc_va_copy.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 14 Mar 2008 14:24:52 +0000 (16:24 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 14 Mar 2008 14:24:52 +0000 (16:24 +0200)
lib/silcutil/silcruntime.h.in
lib/silcutil/silcutil.h

index 80539dab865499185612f0082d516e24b606ff91..d0bc898c94f17eacfe76fc79cac36a9a8bb06a03 100644 (file)
@@ -52,6 +52,7 @@
 @__SILC_HAVE_PTHREAD@
 @__SILC_ENABLE_DEBUG@
 @__SILC_ENABLE_STACKTRACE@
 @__SILC_HAVE_PTHREAD@
 @__SILC_ENABLE_DEBUG@
 @__SILC_ENABLE_STACKTRACE@
+@__SILC_VA_COPY@
 
 /* Types */
 #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
 
 /* Types */
 #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
index 14e6adf53a59724c28a2f4af4f05c1dbf8cd74fe..0b8a4250e77824333c7fba575461cc07e42a6dc5 100644 (file)
@@ -223,15 +223,7 @@ char *silc_get_real_name();
  *    each copied list.
  *
  ***/
  *    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
  *
 
 /****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);
 
 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 */
 #endif /* !SILCUTIL_H */