changeset 1799:19c89a2e24b6

[xemacs-hg @ 2003-11-20 16:04:45 by james] Autodetect the typeof extension.
author james
date Thu, 20 Nov 2003 16:04:47 +0000
parents 5d1a9259f2cb
children 6c853dd06f0d
files src/ChangeLog src/config.h.in src/emacs.c src/ralloc.c
diffstat 4 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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  <james@xemacs.org>
+
+	* 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  <james@xemacs.org>
 
 	* emacs.c (voodoo_free_hook): ICC understands typeof.
--- 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
 
--- 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
--- 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;
     }