From: Paul Eggert Date: Mon, 14 Mar 2011 03:49:40 +0000 (-0700) Subject: * emacs.c (DEFINE_DUMMY_FUNCTION): New macro. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~554^2~119 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=244fc23d16bd60d159ee359a2f9eadff8b9fe8d3;p=emacs.git * emacs.c (DEFINE_DUMMY_FUNCTION): New macro. (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main): Use it. --- diff --git a/src/ChangeLog b/src/ChangeLog index 951732a1306..76da9676289 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,9 @@ 2011-03-14 Paul Eggert * emacs.c (init_cmdargs): Rename local to avoid shadowing. + (DEFINE_DUMMY_FUNCTION): New macro. + (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main): + Use it. * lisp.h (fatal_error_signal): Add decl, since it's exported. diff --git a/src/emacs.c b/src/emacs.c index 0b508fb5be7..54e59a3f3c8 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -547,21 +547,22 @@ static char dump_tz[] = "UtC0"; Provide dummy definitions to avoid error. (We don't have any real constructors or destructors.) */ #ifdef __GNUC__ + +/* Define a dummy function F. Declare F too, to pacify gcc + -Wmissing-prototypes. */ +#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {} + #ifndef GCC_CTORS_IN_LIBC -void __do_global_ctors (void) -{} -void __do_global_ctors_aux (void) -{} -void __do_global_dtors (void) -{} +DEFINE_DUMMY_FUNCTION (__do_global_ctors) +DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux) +DEFINE_DUMMY_FUNCTION (__do_global_dtors) /* GNU/Linux has a bug in its library; avoid an error. */ #ifndef GNU_LINUX char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; #endif char * __DTOR_LIST__[2] = { (char *) (-1), 0 }; #endif /* GCC_CTORS_IN_LIBC */ -void __main (void) -{} +DEFINE_DUMMY_FUNCTION (__main) #endif /* __GNUC__ */ #endif /* ORDINARY_LINK */