]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
added support for va_copy
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 5 Nov 2001 16:41:55 +0000 (16:41 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 5 Nov 2001 16:41:55 +0000 (16:41 +0000)
acconfig.h
configure.in
lib/defines.h
lib/gnutls_priority.c

index b26e72d584ecfebad24e05d11ff6e5e7192cfadb..121cbab932e2305bff2a18470d863737ab9ee170 100644 (file)
@@ -21,6 +21,9 @@
 #undef GNUTLS_VERSION
 
 #undef USE_SIGNALS
+#undef USE_VA_COPY
+#undef HAVE_VA_COPY
+#undef HAVE___VA_COPY
 
 #undef LIBMCRYPT22
 #undef LIBMCRYPT24
index 86e53dbf2af34ce5e23122eb185e43837d1380a9..8aae057b4572874154dc9d987dc6beb5bf4792d8 100644 (file)
@@ -132,6 +132,52 @@ AC_CHECK_HEADERS(utime.h zlib.h errno.h signal.h)
 AC_CHECK_FUNCS(signal sigaction,AC_DEFINE(USE_SIGNALS),)
 AC_CHECK_FUNCS(bzero memset lstat stat umask utime memmove bcopy getpwuid,,)
 
+dnl Defines USE_VA_COPY
+AC_MSG_CHECKING([whether we have va_copy or __va_copy])
+AC_TRY_RUN( 
+changequote(<<, >>)dnl
+<<#include <stdarg.h> 
+int main() {
+va_list a,b;
+va_copy(a, b);  
+return 0;
+}
+>>
+changequote([, ])dnl
+,
+dnl    ************ HAVE_VA_COPY
+AC_DEFINE(HAVE_VA_COPY)
+AC_DEFINE(USE_VA_COPY)
+AC_MSG_RESULT(va_copy)
+,
+dnl     ************ NO VA_COPY
+ dnl Defines USE_VA_COPY
+ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<#include <stdarg.h> 
+ int main() {
+ va_list a,b;
+ __va_copy(a, b);  
+ return 0;
+ }
+ >>
+ changequote([, ])dnl
+ ,
+ dnl   ************ HAVE___VA_COPY
+ AC_DEFINE(HAVE___VA_COPY)
+ AC_DEFINE(USE_VA_COPY)
+ AC_MSG_RESULT(__va_copy)
+ ,
+ dnl    ************ NO __VA_COPY
+ AC_MSG_RESULT(none)
+ )
+,
+dnl **** CROSS COMPILING
+AC_MSG_RESULT(none)
+)
+
+
+
 AC_CHECK_LIB(gdbm, gdbm_open,, AC_MSG_WARN("GDBM was not found. You will not be able to use Server side session resuming."))
 AC_CHECK_LIB(z, compress,,AC_MSG_WARN("ZLIB was not found. You will not be able to use ZLIB compression."))
 
index 485a0a7667840bc08b6538346844ce2241f438bd..42d68e2016ec0bc6723f14674f0659ef8fd77459 100644 (file)
 # endif
 #endif
 
+#ifdef USE_VA_COPY
+# ifndef HAVE_VA_COPY
+# define va_copy(x,y) __va_copy(x,y)
+# endif
+#endif
+
 #endif /* defines_h */
index 747dfbf84482561f882d7266fe09d907fd9ee6d0..a5c94de94deec42656422029119151b34cf3b92c 100644 (file)
@@ -44,7 +44,11 @@ int gnutls_set_cipher_priority( GNUTLS_STATE state, GNUTLS_LIST) {
 
        va_start( ap, state);
 
+#ifdef USE_VA_COPY
+       va_copy( _ap, ap);
+#else
        _ap = ap;
+#endif
 
        while( va_arg(ap, BulkCipherAlgorithm) != 0) {
                num++;
@@ -86,7 +90,12 @@ int gnutls_set_kx_priority( GNUTLS_STATE state, GNUTLS_LIST) {
        int i,num=0;
        
        va_start( ap, state);
+
+#ifdef USE_VA_COPY
+       va_copy( _ap, ap);
+#else
        _ap = ap;
+#endif
 
        while( va_arg(ap, KXAlgorithm) != 0) {
                num++;
@@ -127,7 +136,12 @@ int gnutls_set_mac_priority( GNUTLS_STATE state, GNUTLS_LIST) {
        
        va_start( ap, state);
 
+#ifdef USE_VA_COPY
+       va_copy( _ap, ap);
+#else
        _ap = ap;
+#endif
+
        while( va_arg(ap, MACAlgorithm) != 0) {
                num++;
        }
@@ -166,7 +180,12 @@ int gnutls_set_compression_priority( GNUTLS_STATE state, GNUTLS_LIST) {
        va_list _ap;
        
        va_start( ap, state);
+
+#ifdef USE_VA_COPY
+       va_copy( _ap, ap);
+#else
        _ap = ap;
+#endif
 
        while( va_arg( ap, CompressionMethod) != 0) {
                num++;
@@ -205,7 +224,12 @@ int gnutls_set_protocol_priority( GNUTLS_STATE state, GNUTLS_LIST) {
        va_list _ap;
        
        va_start( ap, state);
+
+#ifdef USE_VA_COPY
+       va_copy( _ap, ap);
+#else
        _ap = ap;
+#endif
 
        while( va_arg( ap, int) != 0) {
                num++;