# HG changeset patch # User james # Date 1069344287 0 # Node ID 19c89a2e24b632754aca9e8c453ce51b5bf6ffc2 # Parent 5d1a9259f2cbc16fd8d78975dfd641b837323319 [xemacs-hg @ 2003-11-20 16:04:45 by james] Autodetect the typeof extension. diff -r 5d1a9259f2cb -r 19c89a2e24b6 src/ChangeLog --- a/src/ChangeLog Wed Nov 19 22:50:39 2003 +0000 +++ b/src/ChangeLog Thu Nov 20 16:04:47 2003 +0000 @@ -1,3 +1,12 @@ +2003-11-18 Jerry James + + * config.h.in: Add TYPEOF. + * emacs.c (voodoo_free_hook): Revert the previous patch and use + TYPEOF instead. + * emacs.c (Fkill_emacs): Ditto. + * ralloc.c (init_ralloc): Ditto. + * ralloc.c (r_alloc_reinit): Ditto. + 2003-11-14 Jerry James * emacs.c (voodoo_free_hook): ICC understands typeof. diff -r 5d1a9259f2cb -r 19c89a2e24b6 src/config.h.in --- a/src/config.h.in Wed Nov 19 22:50:39 2003 +0000 +++ b/src/config.h.in Thu Nov 20 16:04:47 2003 +0000 @@ -121,6 +121,9 @@ /* Make all functions available on Solaris 2 systems. */ #undef __EXTENSIONS__ +/* Define to the name of the typeof extension, if the compiler supports one */ +#undef TYPEOF + /* Used to identify the XEmacs version in stack traces. */ #undef STACK_TRACE_EYE_CATCHER diff -r 5d1a9259f2cb -r 19c89a2e24b6 src/emacs.c --- a/src/emacs.c Wed Nov 19 22:50:39 2003 +0000 +++ b/src/emacs.c Thu Nov 20 16:04:47 2003 +0000 @@ -3338,9 +3338,9 @@ /* Disable all calls to free() when XEmacs is exiting and it doesn't */ /* matter. */ __free_hook = -#if defined (__GNUC__) || defined (__ICC) +#ifdef TYPEOF /* prototype of __free_hook varies with glibc version */ - (__typeof__ (__free_hook)) + (TYPEOF (__free_hook)) #endif voodoo_free_hook; } @@ -3404,9 +3404,9 @@ #if defined (GNU_MALLOC) __free_hook = -#if defined (__GNUC__) || defined (__ICC) +#ifdef TYPEOF /* prototype of __free_hook varies with glibc version */ - (__typeof__ (__free_hook)) + (TYPEOF (__free_hook)) #endif voodoo_free_hook; #endif diff -r 5d1a9259f2cb -r 19c89a2e24b6 src/ralloc.c --- a/src/ralloc.c Wed Nov 19 22:50:39 2003 +0000 +++ b/src/ralloc.c Thu Nov 20 16:04:47 2003 +0000 @@ -1127,8 +1127,8 @@ r_alloc_initialized = 1; real_morecore = (POINTER (*) (ptrdiff_t)) __morecore; __morecore = -#if defined (__GNUC__) || defined (__ICC) - (__typeof__ (__morecore)) +#ifdef TYPEOF + (TYPEOF (__morecore)) #endif r_alloc_sbrk; @@ -1185,8 +1185,8 @@ { real_morecore = (POINTER (*) (ptrdiff_t)) __morecore; __morecore = -#if defined (__GNUC__) || defined (__ICC) - (__typeof__ (__morecore)) +#ifdef TYPEOF + (TYPEOF (__morecore)) #endif r_alloc_sbrk; }