From 77498adcd6156bd65aa146db341b3edc0eb0ff98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 21 Mar 2007 12:18:11 +0000 Subject: [PATCH] New feature needed for JP, build fix with gSoap 2.7.0f. --- .../interface/glite_gscompat.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/org.glite.security.gsoap-plugin/interface/glite_gscompat.h b/org.glite.security.gsoap-plugin/interface/glite_gscompat.h index 163f0ba..38b7d96 100644 --- a/org.glite.security.gsoap-plugin/interface/glite_gscompat.h +++ b/org.glite.security.gsoap-plugin/interface/glite_gscompat.h @@ -18,9 +18,10 @@ #else #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->ITEM) #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) - #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, TYPENAME, TYPENO) (((CHOICE)->ITEM) != NULL) + #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->ITEM) != NULL) #endif #define GLITE_SECURITY_GSOAP_CHOICE_SET(CHOICE, ITEM, NS, TYPENAME, TYPENO, VALUE) do { \ + memset((CHOICE), 0, sizeof(*(CHOICE))); \ GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO); \ GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) = (VALUE); \ } while(0) @@ -44,6 +45,10 @@ else (LIST) = NULL; \ (SIZE) = (N); \ } while (0) + #define GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, LIST, SIZE) do { \ + if ((LIST) && (SIZE) != 0) soap_dealloc((SOAP), (LIST)); \ + (LIST) = NULL; \ +} while (0) #define GLITE_SECURITY_GSOAP_LIST_GET(LIST, INDEX) (&(LIST)[INDEX]) #define GLITE_SECURITY_GSOAP_LIST_TYPE(NS, LIST) struct NS##__##LIST * #else @@ -57,10 +62,17 @@ (LIST)[ilist] = soap_malloc((SOAP), sizeof(TYPE)); \ } \ } while (0) + #define GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, LIST, SIZE) do { \ + int ilist; \ + \ + for (ilist = 0; ilist < (SIZE); ilist++) soap_dealloc((SOAP), (LIST)[ilist]); \ + if ((LIST) && (SIZE) != 0) soap_dealloc((SOAP), (LIST)); \ + (LIST) = NULL; \ +} while (0) #define GLITE_SECURITY_GSOAP_LIST_GET(LIST, INDEX) ((LIST)[INDEX]) #define GLITE_SECURITY_GSOAP_LIST_TYPE(NS, LIST) struct NS##__##LIST ** #endif #define GLITE_SECURITY_GSOAP_LIST_CREATE(SOAP, CONTAINER, LIST, TYPE, N) GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, (CONTAINER)->LIST, (CONTAINER)->__size##LIST, TYPE, N) - +#define GLITE_SECURITY_GSOAP_LIST_DESTROY(SOAP, CONTAINER, LIST) GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, (CONTAINER)->LIST, (CONTAINER)->__size##LIST) #endif -- 1.8.2.3