[Mac-emacs-users] Emacs 21.2 on Darwin: the ctrl-G crash in -nw still exists, old patch still works
Brought to you by:
akochoi
|
From: Marc-Antoine P. <map...@ac...> - 2002-05-26 16:05:50
|
The title says it. I rebuilt the new emacs from CVS today (Thanks
Andrew!) and I noticed that, when I try to use emacs via a terminal
(option -nw) and use ctrl-G, emacs crashes. The content of the old patch
that was posted a while ago still solves this problem.
Applying the patch led to a few errors during patch, which all
correspond to the patche's content having been otherwise integrated in
the source. Ignore those.
Another detail:
The patch adds the line
#define HAVE_ALLOCA
in src/s/darwin.h
This causes a warning during compilation, as HAVE_ALLOCA is now defined
in src/config.h.
I removed it from darwin.h
The resulting patch file looks something like this:
Tell me if I've made a mistake somewhere, I've been doing this somewhat
blindly...
Marc-Antoine Parent
Index: src/callproc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/callproc.c,v
retrieving revision 1.187
diff -c -r1.187 callproc.c
*** src/callproc.c 3 May 2002 20:40:58 -0000 1.187
--- src/callproc.c 26 May 2002 16:01:42 -0000
***************
*** 612,618 ****
--- 612,622 ----
pid = child_setup (filefd, fd1, fd_error, (char **) new_argv,
0, current_dir);
#else /* not WINDOWSNT */
+ #ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+ pid = fork ();
+ #else
pid = vfork ();
+ #endif
if (pid == 0)
{
Index: src/getloadavg.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/getloadavg.c,v
retrieving revision 1.45
diff -c -r1.45 getloadavg.c
*** src/getloadavg.c 20 Jun 2000 13:17:40 -0000 1.45
--- src/getloadavg.c 26 May 2002 16:01:43 -0000
***************
*** 401,407 ****
# define host_self mach_host_self
# endif
! # ifdef NeXT
# ifdef HAVE_MACH_MACH_H
# include <mach/mach.h>
# else
--- 401,407 ----
# define host_self mach_host_self
# endif
! # if defined(NeXT) || defined(MAC_OSX)
# ifdef HAVE_MACH_MACH_H
# include <mach/mach.h>
# else
***************
*** 449,455 ****
/* Avoid static vars inside a function since in HPUX they dump as
pure. */
! # ifdef NeXT
static processor_set_t default_set;
static int getloadavg_initialized;
# endif /* NeXT */
--- 449,455 ----
/* Avoid static vars inside a function since in HPUX they dump as
pure. */
! # if defined(NeXT) || defined(MAC_OSX)
static processor_set_t default_set;
static int getloadavg_initialized;
# endif /* NeXT */
***************
*** 626,638 ****
# endif /* __NetBSD__ */
! # if !defined (LDAV_DONE) && defined (NeXT)
# define LDAV_DONE
/* The NeXT code was adapted from iscreen 3.2. */
host_t host;
struct processor_set_basic_info info;
unsigned info_count;
/* We only know how to get the 1-minute average for this system,
so even if the caller asks for more than 1, we only return 1. */
--- 626,640 ----
# endif /* __NetBSD__ */
! # if !defined (LDAV_DONE) && (defined (NeXT) || defined(MAC_OSX))
# define LDAV_DONE
/* The NeXT code was adapted from iscreen 3.2. */
+ #ifndef MAC_OSX
host_t host;
struct processor_set_basic_info info;
unsigned info_count;
+ #endif
/* We only know how to get the 1-minute average for this system,
so even if the caller asks for more than 1, we only return 1. */
***************
*** 645,650 ****
--- 647,653 ----
if (getloadavg_initialized)
{
+ #ifndef MAC_OSX
info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO,
&host,
(processor_set_info_t) &info, &info_count)
***************
*** 655,660 ****
--- 658,678 ----
if (nelem > 0)
loadavg[elem++] = (double) info.load_average / LOAD_SCALE;
}
+ #else
+ struct processor_set_load_info info;
+ host_t host;
+ unsigned info_count = PROCESSOR_SET_LOAD_INFO_COUNT;
+
+ if (processor_set_info (default_set, PROCESSOR_SET_LOAD_INFO,
&host,
+ (processor_set_info_t) &info, &info_count)
+ != KERN_SUCCESS)
+ getloadavg_initialized = 0;
+ else
+ {
+ if (nelem > 0)
+ loadavg[elem++] = (double) info.load_average / LOAD_SCALE;
+ }
+ #endif
}
if (!getloadavg_initialized)
Index: src/md5.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/md5.h,v
retrieving revision 1.3
diff -c -r1.3 md5.h
*** src/md5.h 6 Dec 2000 21:16:37 -0000 1.3
--- src/md5.h 26 May 2002 16:01:43 -0000
***************
*** 71,77 ****
#endif
! #ifndef __GNUC__
#define __attribute__(X)
#define __alignof__(X) 1
#endif
--- 71,77 ----
#endif
! #if !defined(__GNUC__) || defined(MAC_OSX)
#define __attribute__(X)
#define __alignof__(X) 1
#endif
Index: src/process.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/process.c,v
retrieving revision 1.373
diff -c -r1.373 process.c
*** src/process.c 20 May 2002 08:06:32 -0000 1.373
--- src/process.c 26 May 2002 16:01:47 -0000
***************
*** 1715,1721 ****
--- 1715,1725 ----
current_dir = ENCODE_FILE (current_dir);
#ifndef WINDOWSNT
+ #ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+ pid = fork ();
+ #else
pid = vfork ();
+ #endif
if (pid == 0)
#endif /* not WINDOWSNT */
{
Index: src/regex.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/regex.h,v
retrieving revision 1.29
diff -c -r1.29 regex.h
*** src/regex.h 17 Oct 2000 06:55:04 -0000 1.29
--- src/regex.h 26 May 2002 16:01:48 -0000
***************
*** 533,538 ****
--- 533,540 ----
# else
# define __restrict
# endif
+ # elif defined(MAC_OSX)
+ # define __restrict
# endif
#endif
/* For now unconditionally define __restrict_arr to expand to nothing.
Index: src/sysdep.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/sysdep.c,v
retrieving revision 1.235
diff -c -r1.235 sysdep.c
*** src/sysdep.c 26 Apr 2002 23:39:05 -0000 1.235
--- src/sysdep.c 26 May 2002 16:01:50 -0000
***************
*** 809,815 ****
--- 809,820 ----
synch_process_alive = 1;
#endif /* __DJGPP__ > 1 */
#else
+ #ifndef PUMA_VFORK_ISSUES_CLEARED_UP
+ pid = fork ();
+ #else
pid = vfork ();
+ #endif
+
if (pid == -1)
error ("Can't spawn subshell");
#endif
Index: src/term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.140
diff -c -r1.140 term.c
*** src/term.c 26 May 2002 07:23:47 -0000 1.140
--- src/term.c 26 May 2002 16:01:52 -0000
***************
*** 2171,2176 ****
--- 2171,2180 ----
Initialization
***********************************************************************/
+ #if defined(__APPLE_CC__)
+ __private_extern__ char _emacs_PC;
+ #define PC _emacs_PC
+ #endif
void
term_init (terminal_type)
char *terminal_type;
Index: src/termcap.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/termcap.c,v
retrieving revision 1.23
diff -c -r1.23 termcap.c
*** src/termcap.c 26 Apr 2002 23:39:05 -0000 1.23
--- src/termcap.c 26 May 2002 16:01:52 -0000
***************
*** 301,309 ****
/* Already defined in the System framework in Mac OS X and causes
prebinding to fail. */
! #ifndef MAC_OSX
! char PC;
! #endif /* MAC_OSX */
#ifndef emacs
/* Actual baud rate if positive;
--- 301,312 ----
/* Already defined in the System framework in Mac OS X and causes
prebinding to fail. */
! #ifdef __APPLE_CC__
! __private_extern__ char _emacs_PC = '\0';
! #define PC _emacs_PC
! #else
! char PC;
! #endif
#ifndef emacs
/* Actual baud rate if positive;
Index: src/tparam.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/tparam.c,v
retrieving revision 1.9
diff -c -r1.9 tparam.c
*** src/tparam.c 26 Apr 2002 23:39:05 -0000 1.9
--- src/tparam.c 26 May 2002 16:01:53 -0000
***************
*** 109,117 ****
/* These are already defined in the System framework in Mac OS X and
cause prebinding to fail. */
! #ifndef MAC_OSX
! char *BC;
! char *UP;
static char tgoto_buf[50];
--- 109,123 ----
/* These are already defined in the System framework in Mac OS X and
cause prebinding to fail. */
! #ifdef __APPLE_CC__
! __private_extern__ char *_emacs_BC = NULL;
! __private_extern__ char *_emacs_UP = NULL;
! #define BC _emacs_BC
! #define UP _emacs_UP
! #else
! char *BC;
! char *UP;
! #endif
static char tgoto_buf[50];
***************
*** 127,133 ****
args[1] = hpos;
return tparam1 (cm, tgoto_buf, 50, UP, BC, args);
}
! #endif
static char *
tparam1 (string, outstring, len, up, left, argp)
--- 133,139 ----
args[1] = hpos;
return tparam1 (cm, tgoto_buf, 50, UP, BC, args);
}
!
static char *
tparam1 (string, outstring, len, up, left, argp)
Index: src/m/powermac.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/m/powermac.h,v
retrieving revision 1.1
diff -c -r1.1 powermac.h
*** src/m/powermac.h 26 Apr 2002 23:39:05 -0000 1.1
--- src/m/powermac.h 26 May 2002 16:01:53 -0000
***************
*** 58,68 ****
/* Data type of load average, as read out of kmem. */
! #define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of
1.0 */
! #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* Define CANNOT_DUMP on machines where unexec does not work.
Then the function dump-emacs will not be defined
--- 58,68 ----
/* Data type of load average, as read out of kmem. */
! /* #define LOAD_AVE_TYPE long */
/* Convert that into an integer that is 100 for a load average of
1.0 */
! /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */
/* Define CANNOT_DUMP on machines where unexec does not work.
Then the function dump-emacs will not be defined
***************
*** 119,121 ****
--- 119,123 ----
If you've just fixed a problem in an existing configuration file,
you should also check `etc/MACHINES' to make sure its descriptions
of known problems in that configuration should be updated. */
+
+ #define DATA_SEG_BITS 0
Index: src/s/darwin.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/s/darwin.h,v
retrieving revision 1.1
diff -c -r1.1 darwin.h
*** src/s/darwin.h 26 Apr 2002 23:39:06 -0000 1.1
--- src/s/darwin.h 26 May 2002 16:01:54 -0000
***************
*** 39,45 ****
/* MAC_OS is used to conditionally compile code common to both MAC_OS8
and MAC_OSX. */
! #ifdef MAC_OSX
#define MAC_OS
#endif
--- 39,45 ----
/* MAC_OS is used to conditionally compile code common to both MAC_OS8
and MAC_OSX. */
! #if defined(MAC_OSX) && !defined(HAVE_X11)
#define MAC_OS
#endif
***************
*** 48,53 ****
--- 48,58 ----
#define SYSTEM_TYPE "darwin"
+ #undef KERNEL_FILE
+ #define KERNEL_FILE "/mach_kernel"
+
+ #define HAVE_MACH_MACH_H
+
/* NOMULTIPLEJOBS should be defined if your system's shell
does not have "job control" (the ability to stop a program,
run some other program, then continue the first one). */
***************
*** 202,208 ****
#define __restrict
/* Fix compilation problem for md5.c. */
! #define __attribute__(x)
/* Used in dispnew.c. Copied from freebsd.h. */
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
--- 207,213 ----
#define __restrict
/* Fix compilation problem for md5.c. */
! /* #define __attribute__(x) */
/* Used in dispnew.c. Copied from freebsd.h. */
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
***************
*** 210,215 ****
--- 215,230 ----
/* Darwin provides POSIX-style getpgrp. */
#define GETPGRP_NO_ARG
+ #define TERMCAP_FILE "/usr/share/misc/termcap"
+
+ #define A_OUT_H_FILE
+
+ /* Data type of load average, as read out of kmem. */
+ #define LOAD_AVE_TYPE long
+
+ /* Convert that into an integer that is 100 for a load average of
1.0 */
+ #define LOAD_AVE_CVT(x) (int) (((double)(x)) * 100.0 / FSCALE)
+
/* System uses OXTABS instead of the expected TAB3. (Copied from
bsd386.h.) */
#define TAB3 OXTABS
***************
*** 218,228 ****
--- 233,249 ----
framework. */
#define SYSTEM_MALLOC
+ #define WAIT_USE_INT
+
+ #define SOCKLEN_TYPE int
+
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
/* Extra initialization calls in main for Mac OS X system type. */
+ #ifndef HAVE_X11
#define SYMS_SYSTEM syms_of_mac()
+ #endif
/* Definitions for how to dump. Copied from nextstep.h. */
|