From 4a41ff3928267879eca64c30d2b1dadc9b36a880 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sat, 17 Mar 2007 17:34:58 +0000 Subject: [PATCH] Don't use gsoap_prefix, it's tight with the one predefined default version. New neede gSoap version compatibility macros (used for support 2.7.9b in L&B). --- org.glite.security.gsoap-plugin/Makefile | 6 ---- .../interface/glite_gscompat.h | 35 +++++++++++++++------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/org.glite.security.gsoap-plugin/Makefile b/org.glite.security.gsoap-plugin/Makefile index 9bd9e6c..3b44bc4 100644 --- a/org.glite.security.gsoap-plugin/Makefile +++ b/org.glite.security.gsoap-plugin/Makefile @@ -212,12 +212,6 @@ link-gsoap: ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/src/stdsoap2.[ch] .; \ elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/src/${gsoap_srcname}/soapcpp2/stdsoap2.c ]; then \ ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/src/${gsoap_srcname}/soapcpp2/stdsoap2.[ch] .; \ - elif [ -f ${gsoap_prefix}/stdsoap2.c ]; then \ - ln -sf ${gsoap_prefix}/stdsoap2.[ch] .; \ - elif [ -f ${gsoap_prefix}/src/stdsoap2.c ]; then \ - ln -sf ${gsoap_prefix}/src/stdsoap2.[ch] .; \ - elif [ -f ${gsoap_prefix}/devel/stdsoap2.c ]; then \ - ln -sf ${gsoap_prefix}/devel/stdsoap2.[ch] .; \ else false ; \ fi diff --git a/org.glite.security.gsoap-plugin/interface/glite_gscompat.h b/org.glite.security.gsoap-plugin/interface/glite_gscompat.h index 0bdf5f8..c8df9fc 100644 --- a/org.glite.security.gsoap-plugin/interface/glite_gscompat.h +++ b/org.glite.security.gsoap-plugin/interface/glite_gscompat.h @@ -9,11 +9,21 @@ #if GSOAP_VERSION >= 20709 #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->union_##TYPENAME.ITEM) + #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) ((CHOICE)->__union_##TYPENAME) = SOAP_UNION__##NS##__union_##TYPENAME##_##ITEM + #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->__union_##TYPENAME) == SOAP_UNION__##NS##__union_##TYPENAME##_##ITEM) #elif GSOAP_VERSION >= 20706 #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->union_##TYPENO.ITEM) + #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) ((CHOICE)->__union_##TYPENO) = SOAP_UNION__##NS##__union_##TYPENO##_##ITEM + #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->__union_##TYPENO) == SOAP_UNION__##NS##__union_##TYPENO##_##ITEM) #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) #endif +#define GLITE_SECURITY_GSOAP_CHOICE_SET(CHOICE, ITEM, NS, TYPENAME, TYPENO, VALUE) do { \ + GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO); \ + GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) = (VALUE); \ +} while(0) #if GSOAP_VERSION >= 20706 #define GLITE_SECURITY_GSOAP_REASON2(SOAP) ((SOAP)->fault->SOAP_ENV__Reason ? (SOAP)->fault->SOAP_ENV__Reason->SOAP_ENV__Text : "(no reason)") @@ -29,23 +39,28 @@ #define GLITE_SECURITY_GSOAP_REASON(SOAP) ((SOAP)->version == 2 ? GLITE_SECURITY_GSOAP_REASON2((SOAP)) : (SOAP)->fault->faultstring) #if GSOAP_VERSION >= 20709 - #define GLITE_SECURITY_GSOAP_LIST_CREATE(SOAP, CONTAINER, LIST, TYPE, N) do { \ - (CONTAINER)->LIST = soap_malloc((SOAP), (N) * sizeof(TYPE)); \ - (CONTAINER)->__size##LIST = (N); \ -} while (0); + #define GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, LIST, SIZE, TYPE, N) do { \ + if ((N) != 0) (LIST) = soap_malloc((SOAP), (N) * sizeof(TYPE)); \ + else (LIST) = NULL; \ + (SIZE) = (N); \ +} while (0) #define GLITE_SECURITY_GSOAP_LIST_GET(LIST, INDEX) (&(LIST)[INDEX]) + #define GLITE_SECURITY_GSOAP_LIST_TYPE(NS, LIST) struct NS##__##LIST * #else - #define GLITE_SECURITY_GSOAP_LIST_CREATE(SOAP, CONTAINER, LIST, TYPE, N) do { \ - int i##LIST; \ + #define GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, LIST, SIZE, TYPE, N) do { \ + int ilist; \ \ - (CONTAINER)->LIST = soap_malloc((SOAP), (N) * sizeof(void *));\ - (CONTAINER)->__size##LIST = (N); \ - for (i##LIST = 0; i##LIST < (N); i##LIST++) { \ - (CONTAINER)->LIST[i##LIST] = soap_malloc((SOAP), sizeof(TYPE)); \ + if ((N) != 0) (LIST) = soap_malloc((SOAP), (N) * sizeof(void *)); \ + else (LIST) = NULL; \ + (SIZE) = (N); \ + for (ilist = 0; ilist < (N); ilist++) { \ + (LIST)[ilist] = soap_malloc((SOAP), sizeof(TYPE)); \ } \ } 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) #endif -- 1.8.2.3