]> git.meshlink.io Git - catta/commitdiff
* gcc 2.95 compatibility
authorLennart Poettering <lennart@poettering.net>
Sun, 23 Oct 2005 23:01:13 +0000 (23:01 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 23 Oct 2005 23:01:13 +0000 (23:01 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@849 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-common/domain-test.c
avahi-common/malloc.c
avahi-common/timeval-test.c

index 279be723ee136cd0c2d782b0b1f160e5722f1dc4..9926a1f011369ca7f380cc73172344b7078ca04a 100644 (file)
@@ -58,13 +58,13 @@ int main(int argc, char *argv[]) {
     printf("%u = %u\n", avahi_domain_hash("ccc\\065aa.aa\\.b\\\\."), avahi_domain_hash("cccAaa.aa\\.b\\\\"));
 
 
-    avahi_service_name_join(t, sizeof(t), "foo.foo.foo \.", "_http._tcp", "test.local");
+    avahi_service_name_join(t, sizeof(t), "foo.foo.foo \\.", "_http._tcp", "test.local");
     printf("<%s>\n", t);
 
     avahi_service_name_split(t, name, sizeof(name), type, sizeof(type), domain, sizeof(domain));
     printf("name: <%s>; type: <%s>; domain <%s>\n", name, type, domain);
     
-    avahi_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\. .local");
+    avahi_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\\. .local");
     printf("<%s>\n", t);
 
     avahi_service_name_split(t, NULL, 0, type, sizeof(type), domain, sizeof(domain));
index 52e0962df25a25607f221435d2f16593b5fd8222..51b8ff6aecf93e7015b08ed2c13cf9d653d91122 100644 (file)
 
 #include "malloc.h"
 
+#ifndef va_copy
+#ifdef __va_copy
+#define va_copy(DEST,SRC) __va_copy((DEST),(SRC))
+#else
+#define va_copy(DEST,SRC) memcpy(&(DEST), &(SRC), sizeof(va_list))
+#endif
+#endif
+
 static const AvahiAllocator *allocator = NULL;
 
 static void oom(void) AVAHI_GCC_NORETURN;
@@ -206,9 +214,7 @@ char *avahi_strdup_vprintf(const char *fmt, va_list ap) {
         va_list ap2;
 
         va_copy (ap2, ap);
-        
         n = vsnprintf(buf, len, fmt, ap2);
-
         va_end (ap2);
 
         if (n >= 0 && n < (int) len)
index 7dedf41baf6a0c69bcda1c23de603a00004f9205..4b594d438b2bf1624c63af65ca9bbf2df2d88d86 100644 (file)
@@ -38,4 +38,6 @@ int main(int argc, char *argv[]) {
     printf("%li.%li\n", a.tv_sec, a.tv_usec);
 
     printf("%lli\n", avahi_timeval_diff(&a, &b));
+
+    return 0;
 }