[This is a problem from configuring groff -- I've reported this
already a year ago, but apparently nothing has happened.]

Using CC=g++, AC_TYPE_SIGNAL fails on my Linux box:

  conftest.c:41: error: declaration of
    `void (* signal(int, void (*)(int)))(int)'
    throws different exceptions
  /usr/include/signal.h:90: error: than previous declaration
    `void (* signal(int, void (*)(int)) throw ())(int)'

I have appended a better solution (taken from groff CVS, modeled after
_AC_PROG_CXX_EXIT_DECLARATION).


    Werner


======================================================================


AC_DEFUN([GROFF_TYPE_SIGNAL],
  [AC_MSG_CHECKING([for return type of signal handlers])
   for groff_declaration in \
     'extern "C" void (*signal (int, void (*)(int)))(int);' \
     'extern "C" void (*signal (int, void (*)(int)) throw ())(int);' \
     'void (*signal ()) ();' 
   do
     AC_COMPILE_IFELSE([
         AC_LANG_PROGRAM([[

#include <sys/types.h>
#include <signal.h>
#ifdef signal
# undef signal
#endif
$groff_declaration

         ]],
         [[

int i;

         ]])
       ],
       [break],
       [continue])
   done

   if test -n "$groff_declaration"; then
     AC_MSG_RESULT([void])
     AC_DEFINE([RETSIGTYPE], [void],
       [Define as the return type of signal handlers
        (`int' or `void').])
   else
     AC_MSG_RESULT([int])
     AC_DEFINE([RETSIGTYPE], [int],
       [Define as the return type of signal handlers
        (`int' or `void').])
   fi])


Reply via email to