* 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 279be72..9926a1f 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 52e0962..51b8ff6 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 7dedf41..4b594d4 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;
 }