From: Daniel Colascione Date: Mon, 17 Sep 2012 12:07:36 +0000 (-0800) Subject: Merge from trunk X-Git-Tag: emacs-24.2.90~237^2~61^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2ab329f3b5d52a39f0a45c3d9c129f1c19560142;p=emacs.git Merge from trunk --- 2ab329f3b5d52a39f0a45c3d9c129f1c19560142 diff --cc configure.ac index 7b1ea53312b,d0cbabf3d3d..8f300206df6 --- a/configure.ac +++ b/configure.ac @@@ -1567,32 -1551,7 +1553,31 @@@ AC_SUBST(ns_self_contained AC_SUBST(NS_OBJ) AC_SUBST(NS_OBJC_OBJ) AC_SUBST(LIB_STANDARD) - AC_SUBST_FILE(ns_frag) +HAVE_W32=no +W32_OBJ= +W32_LIBS= +if test "${with_w32}" != no; then + if test "${opsys}" != "cygwin"; then + AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) + fi + AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], + [AC_MSG_ERROR([`--with-w32' was specified, but windows.h + cannot be found.])]) + AC_DEFINE(HAVE_NTGUI, 1, [Define to use native Windows GUI.]) + W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" + W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" + W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" + W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" +fi +AC_SUBST(W32_OBJ) +AC_SUBST(W32_LIBS) + +if test "${HAVE_W32}" = "yes"; then + window_system=w32 + with_xft=no +fi + ## $window_system is now set to the window system we will ## ultimately use. diff --cc src/emacs.c index 7b643f5226f,d4b52ab64ea..80d536a5c14 --- a/src/emacs.c +++ b/src/emacs.c @@@ -161,27 -148,11 +159,27 @@@ static void *my_heap_start static uprintmax_t heap_bss_diff; #endif +/* To run as a daemon under Cocoa or Windows, we must do a fork+exec, + not a simple fork. + + On Cocoa, CoreFoundation lib fails in forked process: + http://developer.apple.com/ReleaseNotes/ + CoreFoundation/CoreFoundation.html) + + On Windows, a Cygwin fork child cannot access the USER subsystem. + + We mark being in the exec'd process by a daemon name argument of + form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors, + NAME is the original daemon name, if any. */ +#if defined (NS_IMPL_COCOA) || defined (HAVE_NTGUI) +# define DAEMON_MUST_EXEC +#endif + - /* Nonzero means running Emacs without interactive terminal. */ - int noninteractive; + /* True means running Emacs without interactive terminal. */ + bool noninteractive; - /* Nonzero means remove site-lisp directories from load-path. */ - int no_site_lisp; + /* True means remove site-lisp directories from load-path. */ + bool no_site_lisp; /* Name for the server started by the daemon.*/ static char *daemon_name; @@@ -707,13 -682,14 +709,14 @@@ main (int argc, char **argv #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif - int no_loadup = 0; + bool no_loadup = 0; char *junk = 0; char *dname_arg = 0; -#ifdef NS_IMPL_COCOA +#ifdef DAEMON_MUST_EXEC char dname_arg2[80]; -#endif +#endif /* DAEMON_MUST_EXEC */ char *ch_to_dir; + struct sigaction fatal_error_action; #if GC_MARK_STACK stack_base = &dummy; diff --cc src/image.c index b5a2e0328eb,8fc1c8637eb..a562868d94d --- a/src/image.c +++ b/src/image.c @@@ -573,9 -568,7 +572,8 @@@ static void x_laplace (struct frame *, static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); -#ifdef HAVE_NTGUI +#ifdef WINDOWSNT +extern Lisp_Object Vlibrary_cache; - #define CACHE_IMAGE_TYPE(type, status) \ do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) #else @@@ -5526,11 -5512,20 +5524,20 @@@ init_png_functions (Lisp_Object librari #define fn_png_set_longjmp_fn png_set_longjmp_fn #endif /* libpng version >= 1.5 */ -#endif /* HAVE_NTGUI */ +#endif /* WINDOWSNT */ + /* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. + Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp + substitute may munge the signal mask, but that should be OK here. + MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in + the system header setjmp.h; don't mess up that. */ + #ifndef HAVE__SETJMP + # define _setjmp(j) setjmp (j) + # define _longjmp longjmp + #endif #if (PNG_LIBPNG_VER < 10500) - #define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) + #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) #else /* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */ diff --cc src/keyboard.c index 992d1a97b3c,01644b3832d..451ffd9d600 --- a/src/keyboard.c +++ b/src/keyboard.c @@@ -3828,13 -3790,17 +3790,17 @@@ kbd_buffer_get_event (KBOARD **kbp #ifdef subprocesses if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4) { - /* Start reading input again, we have processed enough so we can - accept new events again. */ + /* Start reading input again because we have processed enough to + be able to accept new events again. */ unhold_keyboard_input (); - #ifdef SIGIO + #ifdef USABLE_SIGIO if (!noninteractive) - signal (SIGIO, input_available_signal); - #endif /* SIGIO */ + { + struct sigaction action; + emacs_sigaction_init (&action, deliver_input_available_signal); + sigaction (SIGIO, &action, 0); + } + #endif start_polling (); } #endif /* subprocesses */ diff --cc src/w32.c index d779d740724,bcb0511e2fa..d79065e76e0 --- a/src/w32.c +++ b/src/w32.c @@@ -31,8 -31,8 +31,7 @@@ along with GNU Emacs. If not, see #include #include -#include /* for _mbspbrk */ #include - #include #include /* must include CRT headers *before* config.h */ diff --cc src/w32xfns.c index dfafb0ac742,33f40fc7c01..1a67b018dd5 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@@ -19,8 -19,6 +19,7 @@@ along with GNU Emacs. If not, see #include #include - #include + #include "lisp.h" #include "keyboard.h" #include "frame.h"