From: Lennart Poettering Date: Mon, 15 Aug 2005 14:25:32 +0000 (+0000) Subject: gcc 2.95 compatibility X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=fe367caf27dd022258218a768da1ae2ddd246203;p=catta gcc 2.95 compatibility git-svn-id: file:///home/lennart/svn/public/avahi/trunk@332 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-common/alternative-test.c b/avahi-common/alternative-test.c index 7f0223a..7ec0f33 100644 --- a/avahi-common/alternative-test.c +++ b/avahi-common/alternative-test.c @@ -46,4 +46,5 @@ int main(int argc, char *argv[]) { } avahi_free(r); + return 0; } diff --git a/avahi-common/gccmacro.h b/avahi-common/gccmacro.h index 2ac6c1d..24f206f 100644 --- a/avahi-common/gccmacro.h +++ b/avahi-common/gccmacro.h @@ -25,8 +25,12 @@ /** \file gccmacro.h Defines some macros for GCC extensions */ #ifdef __GNUC__ +#if __GNUC__ >= 4 #define AVAHI_GCC_SENTINEL __attribute__ ((sentinel)) -#else +#endif +#endif + +#ifndef AVAHI_GCC_SENTINEL /** Macro for usage of GCC's sentinel compilation warnings */ #define AVAHI_GCC_SENTINEL #endif diff --git a/avahi-core/avahi-reflector.c b/avahi-core/avahi-reflector.c index 33ae7e1..d4a8947 100644 --- a/avahi-core/avahi-reflector.c +++ b/avahi-core/avahi-reflector.c @@ -56,4 +56,6 @@ int main(int argc, char*argv[]) { avahi_server_free(server); avahi_simple_poll_free(simple_poll); + + return 0; } diff --git a/avahi-core/browse.c b/avahi-core/browse.c index 3fb22c8..346783d 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -98,7 +98,10 @@ static void* scan_cache_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEnt static void scan_interface_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) { AvahiSRecordBrowser *b = userdata; - struct cbdata cbdata = { b, i }; + struct cbdata cbdata; + + cbdata.record_browser = b; + cbdata.interface = i; assert(m); assert(i); diff --git a/avahi-daemon/ini-file-parser-test.c b/avahi-daemon/ini-file-parser-test.c index 0dff13f..5ef1ce6 100644 --- a/avahi-daemon/ini-file-parser-test.c +++ b/avahi-daemon/ini-file-parser-test.c @@ -56,4 +56,5 @@ int main(int argc, char *argv[]) { } avahi_ini_file_free(f); + return 0; } diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index d0db0dd..e249304 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -269,7 +269,7 @@ static int parse_command_line(DaemonConfig *c, int argc, char *argv[]) { OPTION_DEBUG }; - static const struct option const long_options[] = { + static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "daemonize", no_argument, NULL, 'D' }, { "kill", no_argument, NULL, 'k' }, @@ -477,7 +477,7 @@ finish: static void log_function(AvahiLogLevel level, const char *txt) { - static const int const log_level_map[] = { + static const int log_level_map[] = { LOG_ERR, LOG_WARNING, LOG_NOTICE, diff --git a/avahi-dnsconfd/main.c b/avahi-dnsconfd/main.c index 56cbad8..26b479e 100644 --- a/avahi-dnsconfd/main.c +++ b/avahi-dnsconfd/main.c @@ -400,7 +400,7 @@ static void help(FILE *f, const char *argv0) { static int parse_command_line(int argc, char *argv[]) { int c; - static const struct option const long_options[] = { + static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "daemonize", no_argument, NULL, 'D' }, { "kill", no_argument, NULL, 'k' },