[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling heimdal+pkinit in a Debian sid



El dc 09 de 02 del 2005 a les 16:42 +0100, en/na Josep Monés i Teixidor
va escriure:

> We need three tiny patches (attached to this email):
> 
>       * queue_h_version.patch will add TAILQ_* macros not present in
>         sys/queue.h version of Debian (see
>         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=278922.
>       * patch uint16_t_unsigned_short.patch will change uint16_t
>         references to unsigned short.
>       * patch uint32_t_unsigned_long.patch will change uint32_t
>         references to unsigned long.

I forgot to attach them :)

Josep

--- lib/asn1/symbol.h.old	2005-01-20 11:18:35.968106648 +0100
+++ lib/asn1/symbol.h	2005-01-20 11:35:20.007469464 +0100
@@ -38,6 +38,46 @@
 
 #include <sys/queue.h>
 
+
+/* Begin workaround for old sys/queue.h */
+#ifndef TAILQ_EMPTY
+#define TAILQ_EMPTY(head)       ((head)->tqh_first == NULL)
+#endif /* TAILQ_EMPTY */
+
+#ifndef TAILQ_FIRST
+#define TAILQ_FIRST(head)       ((head)->tqh_first)
+#endif /* TAILQ_FIRST */
+
+#ifndef TAILQ_NEXT
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#endif /* TAILQ_NEXT */
+
+#ifndef TAILQ_FOREACH
+#define TAILQ_FOREACH(var, head, field)                                 \
+        for ((var) = TAILQ_FIRST((head));                               \
+            (var);                                                      \
+            (var) = TAILQ_NEXT((var), field))
+#endif /* TAILQ_FOREACH */
+
+#ifndef TAILQ_LAST
+#define TAILQ_LAST(head, headname)                                      \
+        (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#endif /* TAILQ_LAST */
+
+#ifndef TAILQ_PREV
+#define TAILQ_PREV(elm, headname, field)                                \
+        (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#endif /* TAILQ_PREV */
+
+#ifndef TAILQ_FOREACH_REVERSE
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field)               \
+        for ((var) = TAILQ_LAST((head), headname);                      \
+            (var);                                                      \
+            (var) = TAILQ_PREV((var), headname, field))
+#endif /* TAILQ_FOREACH_REVERSE */
+/* End workaround for old sys/queue.h */
+
+
 enum typetype { 
     TBitString,
     TBoolean,
diff -Naur heimdal-20050119_old/lib/asn1/asn1-common.h heimdal-20050119/lib/asn1/asn1-common.h
--- heimdal-20050119_old/lib/asn1/asn1-common.h	2005-01-21 14:45:40.442049136 +0100
+++ heimdal-20050119/lib/asn1/asn1-common.h	2005-01-21 14:50:55.158205008 +0100
@@ -24,7 +24,7 @@
 
 typedef struct heim_bmp_string {
     size_t length;
-    uint16_t *data;
+    unsigned short *data;
 } heim_bmp_string;
 
 typedef struct heim_universal_string {
diff -Naur heimdal-20050119_old/lib/asn1/check-der.c heimdal-20050119/lib/asn1/check-der.c
--- heimdal-20050119_old/lib/asn1/check-der.c	2005-01-21 14:45:40.444048832 +0100
+++ heimdal-20050119/lib/asn1/check-der.c	2005-01-21 14:50:55.207197560 +0100
@@ -247,9 +247,9 @@
 static int
 test_bmp_string (void)
 {
-    uint16_t d1[] = { 32 };
+    unsigned short d1[] = { 32 };
     heim_bmp_string s1 = { 1, d1 };
-    uint16_t d2[] = { 32, 32 };
+    unsigned short d2[] = { 32, 32 };
     heim_bmp_string s2 = { 2, d2 };
 
     struct test_case tests[] = {
diff -Naur heimdal-20050119_old/lib/asn1/gen.c heimdal-20050119/lib/asn1/gen.c
--- heimdal-20050119_old/lib/asn1/gen.c	2005-01-21 14:45:40.448048224 +0100
+++ heimdal-20050119/lib/asn1/gen.c	2005-01-21 14:50:55.350175824 +0100
@@ -124,7 +124,7 @@
     fprintf (headerfile,
 	     "typedef struct heim_bmp_string {\n"
 	     "  size_t length;\n"
-	     "  uint16_t *data;\n"
+	     "  unsigned short *data;\n"
 	     "} heim_bmp_string;\n\n");
     fprintf (headerfile,
 	     "typedef struct heim_universal_string {\n"
diff -Naur heimdal-20050119_old/lib/krb5/addr_families.c heimdal-20050119/lib/krb5/addr_families.c
--- heimdal-20050119_old/lib/krb5/addr_families.c	2005-01-21 14:45:40.513038344 +0100
+++ heimdal-20050119/lib/krb5/addr_families.c	2005-01-21 14:50:56.998925176 +0100
@@ -519,7 +519,7 @@
 addrport_print_addr (const krb5_address *addr, char *str, size_t len)
 {
     krb5_address addr1, addr2;
-    uint16_t port = 0;
+    unsigned short port = 0;
     size_t ret_len = 0, l;
     krb5_storage *sp = krb5_storage_from_data((krb5_data*)&addr->address);
     /* for totally obscure reasons, these are not in network byteorder */
diff -Naur heimdal-20050119_old/lib/roken/getifaddrs.c heimdal-20050119/lib/roken/getifaddrs.c
--- heimdal-20050119_old/lib/roken/getifaddrs.c	2005-01-21 14:45:40.618022384 +0100
+++ heimdal-20050119/lib/roken/getifaddrs.c	2005-01-21 14:50:59.101605520 +0100
@@ -517,7 +517,7 @@
     char *data = NULL, *xdata = NULL;
     void *ifdata = NULL;
     char *ifname = NULL, **iflist = NULL;
-    uint16_t *ifflist = NULL;
+    unsigned short *ifflist = NULL;
     struct rtmaddr_ifamap ifamap;
 
     if (build){
@@ -527,7 +527,7 @@
       ifa = (struct ifaddrs *)data;
       ifdata = calloc(1, 
 		      NLMSG_ALIGN(sizeof(char *[max_ifindex+1]))
-		      + NLMSG_ALIGN(sizeof(uint16_t [max_ifindex+1])));
+		      + NLMSG_ALIGN(sizeof(unsigned short [max_ifindex+1])));
       if (ifap != NULL)
 	*ifap = (ifdata != NULL) ? ifa : NULL;
       else{
@@ -545,7 +545,7 @@
       xdata = data + dlen;
       ifname = xdata + xlen;
       iflist = ifdata;
-      ifflist = (uint16_t *)(((char *)iflist) + NLMSG_ALIGN(sizeof(char *[max_ifindex+1])));
+      ifflist = (unsigned short *)(((char *)iflist) + NLMSG_ALIGN(sizeof(char *[max_ifindex+1])));
     }
 
     for (nlm=nlmsg_list; nlm; nlm=nlm->nlm_next){
diff -Naur heimdal-20050119_old/lib/asn1/asn1-common.h heimdal-20050119/lib/asn1/asn1-common.h
--- heimdal-20050119_old/lib/asn1/asn1-common.h	2005-01-21 14:52:20.404245640 +0100
+++ heimdal-20050119/lib/asn1/asn1-common.h	2005-01-21 14:52:44.947514496 +0100
@@ -29,7 +29,7 @@
 
 typedef struct heim_universal_string {
     size_t length;
-    uint32_t *data;
+    unsigned long *data;
 } heim_universal_string;
 
 
diff -Naur heimdal-20050119_old/lib/asn1/gen.c heimdal-20050119/lib/asn1/gen.c
--- heimdal-20050119_old/lib/asn1/gen.c	2005-01-21 14:52:20.410244728 +0100
+++ heimdal-20050119/lib/asn1/gen.c	2005-01-21 14:52:45.143484704 +0100
@@ -129,7 +129,7 @@
     fprintf (headerfile,
 	     "typedef struct heim_universal_string {\n"
 	     "  size_t length;\n"
-	     "  uint32_t *data;\n"
+	     "  unsigned long *data;\n"
 	     "} heim_universal_string;\n\n");
     fprintf (headerfile,
 	     "typedef struct heim_oid {\n"
diff -Naur heimdal-20050119_old/lib/gssapi/import_name.c heimdal-20050119/lib/gssapi/import_name.c
--- heimdal-20050119_old/lib/gssapi/import_name.c	2005-01-21 14:52:20.431241536 +0100
+++ heimdal-20050119/lib/gssapi/import_name.c	2005-01-21 14:52:45.647408096 +0100
@@ -143,7 +143,7 @@
 		    gss_name_t *output_name)
 {
     unsigned char *p;
-    uint32_t length;
+    unsigned long length;
     OM_uint32 ret;
     char *name;
 
diff -Naur heimdal-20050119_old/lib/roken/getifaddrs.c heimdal-20050119/lib/roken/getifaddrs.c
--- heimdal-20050119_old/lib/roken/getifaddrs.c	2005-01-21 14:52:20.574219800 +0100
+++ heimdal-20050119/lib/roken/getifaddrs.c	2005-01-21 14:52:48.915911208 +0100
@@ -180,7 +180,7 @@
 ifa_make_sockaddr(sa_family_t family, 
 		  struct sockaddr *sa, 
 		  void *p, size_t len,
-		  uint32_t scope, uint32_t scopeid)
+		  unsigned long scope, unsigned long scopeid)
 {
   if (sa == NULL) return;
   switch(family){
@@ -212,11 +212,11 @@
 static struct sockaddr *
 ifa_make_sockaddr_mask(sa_family_t family, 
 		       struct sockaddr *sa, 
-		       uint32_t prefixlen)
+		       unsigned long prefixlen)
 {
   int i;
   char *p = NULL, c;
-  uint32_t max_prefixlen = 0;
+  unsigned long max_prefixlen = 0;
 
   if (sa == NULL) return NULL;
   switch(family){
@@ -473,7 +473,7 @@
   /* - - - - - - - - - - - - - - - */
   int icnt;
   size_t dlen, xlen, nlen;
-  uint32_t max_ifindex = 0;
+  unsigned long max_ifindex = 0;
 
   pid_t pid = getpid();
   int seq;
@@ -561,9 +561,9 @@
 
 	size_t nlm_struct_size = 0;
 	sa_family_t nlm_family = 0;
-	uint32_t nlm_scope = 0, nlm_index = 0;
+	unsigned long nlm_scope = 0, nlm_index = 0;
 	size_t sockaddr_size = 0;
-	uint32_t nlm_prefixlen = 0;
+	unsigned long nlm_prefixlen = 0;
 	size_t rtasize;
 
 	memset(&ifamap, 0, sizeof(ifamap));