1. 07 Oct, 2012 2 commits
    • Jan Djärv's avatar
      Check for OSX >= 10.4 to match what the maunal says and what we actually support. · 335f5ae4
      Jan Djärv authored
      * configure.ac: Check that OSX is 10.4 or newer.
      
      * etc/NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required.
      
      * src/nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
      (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
      
      * src/nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
      
      * src/nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.
      
      * src/nsselect.m (ns_string_from_pasteboard): Remove check for >=
      MAC_OS_X_VERSION_10_4.
      
      * src/nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
      (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
      (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
      335f5ae4
    • Paul Eggert's avatar
      Improve sys_siglist detection. · c622b48f
      Paul Eggert authored
      * configure.ac (sys_siglist): Look for its decl in <signal.h>.
      Otherwise, it's not found in either Fedora 17 or Solaris 11.
      * src/sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
      defined as a macro, as is done in Solaris.
      (sys_siglist_entries): New macro.
      (save_strsignal): Use it.
      * src/syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
      GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
      c622b48f
  2. 04 Oct, 2012 3 commits
    • Paul Eggert's avatar
      Move ChangeLog entry to proper file. · 7509f454
      Paul Eggert authored
      7509f454
    • Paul Eggert's avatar
      Merge from gnulib. · bb1dfdad
      Paul Eggert authored
      bb1dfdad
    • Paul Eggert's avatar
      Port timers to OpenBSD, plus check for timer failures. · 2b794d69
      Paul Eggert authored
      OpenBSD problem reported by Han Boetes.
      * profiler.c (setup_cpu_timer): Check for failure of timer_settime
      and/or setitimer.
      (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
      * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
      like OpenBSD, which has timer_settime but does not declare it.
      OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
      whether to use itimerspec-related primitives.  All uses of
      HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
      2b794d69
  3. 30 Sep, 2012 1 commit
  4. 27 Sep, 2012 2 commits
  5. 24 Sep, 2012 1 commit
    • Stefan Monnier's avatar
      Rewrite sampler to use Elisp hash-tables. · 3d80c99f
      Stefan Monnier authored
      * src/profiler.c: Remove filtering functionality.
      (is_in_trace, Qgc): Remove vars.
      (make_log, record_backtrace, Fsample_profiler_log):
      Rewrite, using Elisp hash-tables.
      (approximate_median, evict_lower_half): New functions.
      (cpu_log): Rename from sample_log.
      (cpu_gc_count): New var.
      (Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
      (sigprof_handler): Add count to cpu_gc_count during GC, detected via
      backtrace_list.
      (block_sigprof, unblock_sigprof): Remove.
      (gc_probe, mark_profiler): Remove functions.
      (syms_of_profiler): Staticpro cpu_log and memory_log.
      
      * lisp/profiler.el (profiler-sample-interval): Move before first use.
      Change default to 1ms.
      (profiler-entry=, profiler-backtrace-reverse, profiler-log-fixup-slot)
      (profiler-calltree-elapsed<, profiler-calltree-elapsed>): Remove functions.
      (profiler-entry-format): Don't use type-of.
      (profiler-slot, profiler-log): Remove structs.
      (profiler-log-timestamp, profiler-log-type, profiler-log-diff-p):
      Redefine for new log representation.
      (profiler-log-diff, profiler-log-fixup, profiler-calltree-build-1):
      Rewrite for new log representation.
      (profiler-calltree): Remove `elapsed' fields.
      (profiler-calltree-count<, profiler-report-make-entry-part):
      Remove gc special case.
      (profiler-calltree-find): Use equal.
      (profiler-calltree-walk): Remove `args'; rely on closures instead.
      (profiler-calltree-compute-percentages-1): Remove; inlined.
      (profiler-calltree-compute-percentages): Simplify.
      (profiler-report-log, profiler-report-reversed)
      (profiler-report-order): Use defvar-local.
      (profiler-report-line-format): Remove `elapsed', do a bit of CSE.
      (profiler-report-mode-map): Remove up/down bindings.
      (profiler-report-make-buffer-name): Simplify by CSE.
      (profiler-report-mode): Remove redundant code.
      (profiler-report-expand-entry, profiler-report-collapse-entry):
      Use inhibit-read-only.
      (profiler-report-render-calltree-1): Simplify by CSE.
      (profiler-reset): Rewrite for new subroutines.
      (profiler--report-cpu): Rename from sample-profiler-report.
      (profiler--report-memory): Rename from memory-profiler-report.
      
      * src/alloc.c (Fgarbage_collect): Record itself in backtrace_list.
      Don't set is_in_trace any more.  Don't call mark_profiler.
      Only call gc_probe for the memory profiler.
      (syms_of_alloc): Define Qautomatic_gc.
      
      * src/lisp.h (SXHASH_COMBINE): Move back to...
      * src/fns.c (SXHASH_COMBINE): ...here.
      
      * src/xdisp.c (Qautomatic_redisplay): New constant.
      (redisplay_internal): Record itself in backtrace_list.
      (syms_of_xdisp): Define Qautomatic_redisplay.
      
      * .dir-locals.el (indent-tabs-mode): Remove personal preference.
      3d80c99f
  6. 23 Sep, 2012 1 commit
  7. 22 Sep, 2012 2 commits
  8. 19 Sep, 2012 1 commit
    • Tassilo Horn's avatar
      New feature: set optimal slice from BoundingBox information. · db8a5a18
      Tassilo Horn authored
      * doc-view.el (doc-view-mode-map): Add keybinding.
      (doc-view-menu): Add menu entry.
      (doc-view-set-slice): Adapt docstring.
      (doc-view-get-bounding-box, doc-view-guess-paper-size)
      (doc-view-scale-bounding-box)
      (doc-view-set-slice-from-bounding-box): New functions.
      (doc-view-paper-sizes): New defvar.
      
      * doc/emacs/misc.texi (DocView Slicing): Document new slice from
      BoundingBox feature.
      db8a5a18
  9. 18 Sep, 2012 1 commit
  10. 17 Sep, 2012 5 commits
    • Andreas Schwab's avatar
      * Makefile.in (bootstrap): Revert last change. Run config.status · d3612ac3
      Andreas Schwab authored
      after config.status --recheck, run configure from $(srcdir).
      (config.status): Run configure from $(srcdir).
      d3612ac3
    • Paul Eggert's avatar
      * Makefile.in: Run autogen/copy_autogen if autogen.sh fails, · dee26dfa
      Paul Eggert authored
      to create 'configure'; problem reported by Andreas Schwab in
      <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00438.html>.
      * autogen.sh: Exit with status 1 when failing due to missing tools,
      reverting the 2012-09-10 change to this file.
      * autogen/copy_autogen: Fail if one of the subsidiary actions fail.
      Use 'cp -f' for the build-aux files, since the destinations are
      typically read-only.
      dee26dfa
    • Paul Eggert's avatar
      * Makefile.in: Fix build error on FreeBSD. · 50bfc824
      Paul Eggert authored
      ($(MAKEFILE_NAME)): Pass MAKE='$(MAKE)' to config.status's env.
      Suggested by Wolfgang Jenker in
      <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00430.html>.
      (MAKE_CONFIG_STATUS): Remove.  Remaining use expanded.
      This undoes part of the 2012-09-10 patch.
      (bootstrap): Run ./configure, rather than trying to run config.status
      if it exists.  That builds src/epaths.h more reliably.
      50bfc824
    • Paul Eggert's avatar
      Remove no-longer-needed Solaris 2.4 vfork bug workaround. · eeceac93
      Paul Eggert authored
      The workaround was for improving performance on Solaris 2.4, but
      is getting in the way now.  Emacs will still work if someone is
      still running Solaris 2.4 in a museum somewhere; Sun dropped
      support for Solaris 2.4 in 2003.
      * configure.ac (ac_cv_func_vfork_works): Default to 'no' on
      Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works.
      * src/callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
      * src/process.c (create_process) [HAVE_WORKING_VFORK]:
      Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
      since Emacs no longer uses vfork on that platform.
      eeceac93
    • Glenn Morris's avatar
      Reduce the number of versioned files storing the short copyright string · 78f83752
      Glenn Morris authored
      * configure.ac (copyright): New output variable.
      (COPYRIGHT): New AC_DEFINE.
      
      * admin/admin.el (set-copyright): No more need to set copyrights for
      nextstep, or .c files.  Add configure.ac and config.nt.
      
      * lib-src/ebrowse.c (version):
      * lib-src/etags.c (print_version): Use COPYRIGHT.
      
      * nextstep/templates/Info-gnustep.plist.in:
      * nextstep/templates/InfoPlist.strings.in:
      * nextstep/templates/Info.plist.in: Let configure set copyright.
      
      * nt/config.nt (COPYRIGHT): New.
      
      * src/emacs.c: Use COPYRIGHT.
      78f83752
  11. 16 Sep, 2012 3 commits
    • Paul Eggert's avatar
      Remove configure's --without-sync-input option. · 0caaedb1
      Paul Eggert authored
      When auditing signal-handling in preparation for cleaning it up,
      I found that SYNC_INPUT has race conditions and would be a real
      pain to fix.  Since it's an undocumented and deprecated
      configure-time option, now seems like a good time to remove it.
      Also see <http://bugs.gnu.org/11080#16>.
      * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
      * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
      * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now
      behaves as if SYNC_INPUT is always true.
      * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
      (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
      (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      (malloc_hysteresis):
      (check_depth) [XMALLOC_OVERRUN_CHECK]:
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
      (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
      (dont_register_blocks, bytes_used_when_reconsidered)
      (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
      (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
      [!SYSTEM_MALLOC && !SYNC_INPUT]:
      Remove. All uses removed.
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
      implementation, one that depends on whether the new macro
      XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
      is defined.
      * src/atimer.c (run_timers, handle_alarm_signal):
      * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
      (handle_async_input, process_pending_signals)
      (handle_input_available_signal, init_keyboard):
      * src/nsterm.m (ns_read_socket):
      * src/process.c (wait_reading_process_output):
      * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
      * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]:
      (emacs_write):
      * src/xterm.c (XTread_socket):
      Assume SYNC_INPUT.
      * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
      * src/eval.c (handling_signal): Remove.  All uses removed.
      * src/lisp.h (ELSE_PENDING_SIGNALS): Remove.
      All uses replaced with the SYNC_INPUT version.
      (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
      Remove decls.
      * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Now static.
      
      Fixes: debbugs:12450
      0caaedb1
    • Glenn Morris's avatar
      92f7c6f1
    • Glenn Morris's avatar
      Increase compartmentalization of Nextstep builds rules, · 83da1b55
      Glenn Morris authored
      and store Emacs version number in fewer versioned files.
      
      * configure.ac (ns_appsrc): Use relative names.
      (ns_frag): Remove.
      (Info-gnustep.plist, Emacs.desktop, Info.plist, InfoPlist.strings)
      (nextstep/Makefile): Generate these nextstep files.
      (SUBDIR_MAKEFILES): Add nextstep.
      
      * Makefile.in (clean, distclean, bootstrap-clean): Add nextstep.
      
      * make-dist (nextstep/templates): Add directory.
      (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove.
      (nextstep/Cocoa/Emacs.base/Contents)
      (nextstep/GNUstep/Emacs.base/Resources): Update contents.
      
      * .bzrignore: Add some nextstep files.
      
      * admin/admin.el (set-version): No more need to set nextstep versions.
      (set-copyright): Update for moved nextstep files.
      
      * nextstep/Makefile.in: New file.
      * nextstep/templates: New directory.
      * nextstep/templates/Emacs.desktop.in, nextstep/templates/Info-gnustep.plist.in:
      * nextstep/templates/Info.plist.in, nextstep/templates/InfoPlist.strings.in:
      Move here from various Cocoa/, GNUstep/ locations.
      Let configure set the version number.
      * nextstep/Cocoa/Emacs.base/Contents/Info.plist:
      * nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:
      * nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:
      * nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop: Move to templates/.
      * nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj: Remove directory.
      
      * src/Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
      (ns_frag): Remove.
      (ns-app): Move here from ns.mk, and simplify.
      (clean): Simplify nextstep entry.
      * src/ns.mk: Remove file.
      83da1b55
  12. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  13. 14 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Fix glitches with 'configure --without-sync-input'. · 2af03429
      Paul Eggert authored
      * configure.ac (--without-sync-input): Fix typo in usage message.
      * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      Include "syssignal.h", for 'main_thread'.
      2af03429
    • Paul Eggert's avatar
      * configure.ac: Port to hosts lacking gtk. · e3141fcf
      Paul Eggert authored
      (PKG_CHECK_MODULES): Capture pkg-config diagnostics
      better, in particular, problems in invoking pkg-config itself.
      This is useful on hosts that don't have pkg-config.
      (GTK_MODULES): Do not exit 'configure' simply because gtk3
      and gtk2 are both missing.  Problem found on Solaris 8.
      e3141fcf
  14. 13 Sep, 2012 3 commits
    • Jan Djärv's avatar
      * configure.ac: Report Gtk+ 3 as GTK. · 4d0b77fc
      Jan Djärv authored
      4d0b77fc
    • Jan Djärv's avatar
      * configure.ac: Reorder Xaw3d messages. · 2c484e75
      Jan Djärv authored
      2c484e75
    • Paul Eggert's avatar
      Simplify SIGIO usage. · 4a4bbad2
      Paul Eggert authored
      The code that dealt with SIGIO was crufty and confusing, e.g., it
      played tricks like "#undef SIGIO" but these tricks were not used
      consistently.  Simplify mostly by not #undeffing standard symbols,
      e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
      or not as we please) rather than "defined SIGIO" (standard symbol
      that we probably shouldn't #undef).
      * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO)
      (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove.
      (USABLE_FIONREAD, USABLE_SIGIO): New symbols.  All uses of
      'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need
      to #undef SIGIO now (which was error-prone).  Likewise, all uses
      of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'.
      * src/admin/CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL)
      (BROKEN_SIGPTY, NO_TERMIO): Remove.
      * src/conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
      Modules that need it can include it.
      [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
      * src/dispextern.h (ignore_sigio): New decl.
      * src/emacs.c (shut_down_emacs): Invoke unrequest_sigio
      unconditionally, since it's now a no-op if !USABLE_SIGIO.
      * src/emacs.c (shut_down_emacs):
      * src/keyboard.c (kbd_buffer_store_event_hold):
      Use ignore_sigio rather than invoking 'signal' directly.
      * src/keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
      for FIONREAD.
      (FIONREAD, SIGIO): Do not #undef.
      (tty_read_avail_input): Use #error rather than a syntax error.
      * src/process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
      for I_PIPE, used by SETUP_SLAVE_PTY.
      (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
      * src/sysdep.c (croak): Remove; no longer needed.  This bit of
      temporary code, with Fred N. Fish's comment that it's temporary,
      has been in Emacs since at least 1992!
      (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
      Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
      * src/syssignal.h (croak): Remove decl.
      (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
      * src/systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
      now that we're termios-only.
      (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
      * src/term.c (dissociate_if_controlling_tty): Use #error rather than
      a run-time error.
      
      Fixes: debbugs:12408
      4a4bbad2
  15. 12 Sep, 2012 1 commit
  16. 11 Sep, 2012 2 commits
    • Glenn Morris's avatar
      Be more explicit about some Makefile dependencies · 9d9edd4b
      Glenn Morris authored
      * Makefile.in (install-arch-dep, install-arch-indep, install-doc):
      Be more explicit about dependencies, for parallel `make install'.
      
      It is not so unreasonable to run `make -j# install' from a clean state
      for a self-contained NS build, where the "installation" happens within
      the build tree.
      9d9edd4b
    • Paul Eggert's avatar
      Simplify, document, and port floating-point. · c990426a
      Paul Eggert authored
      The porting part of this patch fixes bugs on non-IEEE platforms
      with frexp, ldexp, logb.
      * admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove.
      * configure.ac (logb, cbrt): Do not check for these functions,
      as they are not being used.
      * doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions):
      Document that / and mod (with floating point arguments), along
      with asin, acos, log, log10, expt and sqrt, return special values
      instead of signaling exceptions.
      (Float Basics): Document that logb operates on the absolute value
      of its argument.
      (Math Functions): Document that (log ARG BASE) also returns NaN if
      BASE is negative.  Document that (expt X Y) returns NaN if X is a
      finite negative number and Y a finite non-integer.
      * etc/NEWS: Document NaNs versus signaling-error change.
      * src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
      Now static.
      * src/floatfns.c: Simplify discussion of functions that Emacs doesn't
      support, by removing commented-out code and briefly listing the
      C89 functions excluded.  The commented-out stuff was confusing
      maintenance, e.g., we thought we needed cbrt but it was commented out.
      (logb): Remove decl; no longer needed.
      (isfinite): New macro, if not already supplied.
      (isnan): Don't replace any existing macro.
      (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
      are present on all C89 platforms.
      (Ffrexp): Do not special-case zero, as frexp does the right thing
      for that case.
      (Flogb): Do not use logb, as it doesn't have the desired meaning
      on hosts that use non-base-2 floating point.  Instead, stick with
      frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
      frexp, to avoid getting an unspecified result.
      c990426a
  17. 10 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Improve robustness of 'make bootstrap'. · b8b0239f
      Paul Eggert authored
      Run autogen.sh after bootstrap-clean, to avoid bzr pull issues.
      * INSTALL, README: Document autogen.sh.
      * Makefile.in (Makefile): Mark it as precious, since it's updated
      atomically.
      (MAKE_CONFIG_STATUS): New macro.
      (config.status, bootstrap): Use it.  This causes 'make bootstrap'
      to run config.status with the --recheck option, which is more
      appropriate for a bootstrap.
      (bootstrap): Run autogen.sh right after cleaning.  Don't worry
      about failures due to missing tools.
      * autogen.sh: Exit with status 101 when failing due to missing tools.
      * make-dist: Distribute autogen.sh.
      
      Fixes: debbugs:12376
      b8b0239f
  18. 09 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Assume C89 or later for math functions. · f6196b87
      Paul Eggert authored
      This simplifies the code, and makes it a bit smaller and faster,
      and (most important) makes it easier to clean up signal handling
      since we can stop worring about floating-point exceptions in
      library code.  That was a problem before C89, but the problem
      went away many years ago on all practical Emacs targets.
      * configure.ac (frexp, fmod): Remove checks for these functions,
      as we now assume them.
      (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR)
      (HAVE_EXCEPTION):
      Remove; no longer needed.
      * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN)
      (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.
      * src/data.c, src/image.c, src/lread.c, src/print.c:
      Don't include <math.h>; no longer needed.
      * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
      might be autoconfigured, as that never happens.
      * src/data.c (fmod):
      * src/doprnt.c (DBL_MAX_10_EXP):
      * src/print.c (DBL_DIG):
      Remove.  C89 or later always defines these.
      * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
      (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
      (arith_error, domain_error, domain_error2):
      Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
      no longer needed -- we simply return what C returns.  All uses removed.
      (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
      the wrapped code.
      (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
      Remove.  All uses expanded, as these macros are no longer used
      more than once and are now more trouble than they're worth.
      (Ftan): Use tan, not sin / cos.
      (Flogb): Assume C89 frexp.
      (fmod_float): Assume C89 fmod.
      (matherr) [HAVE_MATHERR]: Remove; no longer needed.
      (init_floatfns): Remove.  All uses removed.
      f6196b87
  19. 07 Sep, 2012 2 commits
    • Paul Eggert's avatar
      More signal-handler cleanup. · 1a4f1e9b
      Paul Eggert authored
      * configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327).
      * src/floatfns.c: Comment fix.
      * src/lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
      SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
      and anyway the declaration is harmless even if SIGDANGER is not defined.
      * src/syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
      defined BROKEN_FIONREAD).  systty.h formerly did this, but other
      source files not surprisingly expected syssignal.h to define, or
      not define, SIGIO, and it's cleaner to do it that way, for consistency.
      Include <sys/ioctl.h>, for FIONREAD.
      * src/systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
      This eliminates a problem whereby other files mysteriously had
      to include "syssignal.h" before including "systty.h" if they
      wanted to use "#ifdef SIGIO".
      1a4f1e9b
    • Paul Eggert's avatar
      Signal-handler cleanup. · 2fe28299
      Paul Eggert authored
      Emacs's signal handlers were written in the old 4.2BSD style with
      sigblock and sigmask and so forth, and this led to some
      inefficiencies and confusion.  Rewrite these to use
      pthread_sigmask etc. without copying signal sets around.  Also,
      get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
      'signal', and instead use functions that do not attempt to take
      over the system name space.  This patch causes Emacs's text
      segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
      * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
      Adjust to syssignal.h changes.
      (SIGNAL_H_AB): Remove; no longer needed.
      * src/alloc.c, src/emacsgtkfixed.c, src/nsfns.m, src/widget.c, src/xmenu.c:
      Do not include <signal.h> or "syssignal.h", as these
      modules do not use signals.
      * src/atimer.c, src/callproc.c, src/data.c, src/dispnew.c, src/emacs.c:
      * src/floatfns.c, src/gtkutil.c, src/keyboard.c, src/process.c, src/sound.c:
      * src/sysdep.c, src/term.c, src/xterm.c:
      Do not include <signal.h>, as "syssignal.h" does that for us now.
      * src/atimer.c (sigmask_atimers): New function.
      (block_atimers, unblock_atimers): New functions,
      replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
      All uses replaced.
      * src/conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
      no longer needed here.
      * src/emacs.c (main): Inspect existing signal handler with sigaction,
      so that there's	no need to block and unblock SIGHUP.
      * src/sysdep.c (struct save_signal): New member 'action', replacing
      old member 'handler'.
      (save_signal_handlers, restore_signal_handlers):
      Use sigaction instead of 'signal' to save and restore.
      (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
      New function.  All users of 'signal' modified to use set_sighandler
      if they're writeonly, and to use sys_signal if they're read+write.
      (emacs_sigaction_init, forwarded_signal): New functions.
      (sys_signal): Remove.  All uses replaced by calls to sigaction
      and emacs_sigaction_init, or by direct calls to 'signal'.
      (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
      all uses replaced by pthread_sigmask etc. calls.
      * src/syssignal.h: Include <signal.h>.
      (emacs_sigaction_init, forwarded_signal): New decls.
      (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
      (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
      (sigmask, sys_sigmask): Remove; no longer needed.
      (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
      (sigblock, sigunblock, sigfree):
      (sigsetmask) [!defined sigsetmask]:
      Remove.  All uses replaced by pthread_sigmask.
      (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
      no longer need to be replaced, and its typical old uses
      are now done via emacs_sigaction_init and sigaction.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
      (sys_sigdel): Remove; unused.
      (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
      
      Fixes: debbugs:12327
      2fe28299
  20. 04 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
    • Paul Eggert's avatar
      * configure.ac (_setjmp, _longjmp): Check by compiling · 7b6c362e
      Paul Eggert authored
      instead of by guessing.  The guesses were wrong for
      recent versions of Solaris, such as Solaris 11.
      7b6c362e
  21. 03 Sep, 2012 2 commits
  22. 02 Sep, 2012 1 commit