1. 04 Feb, 2019 1 commit
    • Eli Zaretskii's avatar
      Support (locale-info 'paper) on MS-Windows · f37000ae
      Eli Zaretskii authored
      * src/w32proc.c (LOCALE_IPAPERSIZE): Define if undefined.
      (nl_langinfo): Support _NL_PAPER_WIDTH and _NL_PAPER_HEIGHT
      like glibc does.
      * src/fns.c (Flocale_info): Update the doc string.
      
      * nt/inc/langinfo.h: Add _NL_PAPER_WIDTH and _NL_PAPER_HEIGHT
      to the enumeration.
      (_NL_PAPER_WIDTH, _NL_PAPER_HEIGHT): Define namesake macros.
      * nt/mingw-cfg.site (emacs_cv_langinfo__nl_paper_width): Set
      to 'yes'.
      
      * doc/lispref/nonascii.texi (Locales): Update the
      documentation of 'locale-info' for the argument of 'paper'.
      
      * etc/NEWS: Update the locale-info entry.
      f37000ae
  2. 01 Jan, 2019 1 commit
  3. 03 Dec, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix WINDOWSNT/DOS_NT build · 2ff9dca1
      Eli Zaretskii authored
      Recent changes in sysdep.c and emacsclient unnecessarily
      removed useful code from DOS_NT builds.  This changeset
      reinstates that code.
      * nt/inc/ms-w32.h (tcdrain): Redirect to _commit.
      (fdatasync): No need to redirect anymore.
      
      * lib-src/emacsclient.c (flush_stdout): Don't avoid calling
      tcdrain on DOS_NT platforms.
      
      * src/sysdep.c (reset_sys_modes): Don't ifdef away the call to
      tcdrain on DOS_NT platforms.
      2ff9dca1
  4. 29 Jul, 2018 1 commit
  5. 28 Jul, 2018 2 commits
  6. 01 Jan, 2018 1 commit
  7. 30 Sep, 2017 1 commit
  8. 12 Aug, 2017 1 commit
    • Eli Zaretskii's avatar
      Use Gnulib 'tempname' on MS-Windows · 8cc8ad02
      Eli Zaretskii authored
      * lib-src/ntlib.h (mkdir, open): Remove redefinitions.  They are
      now in nt/inc/ms-w32.h.
      * lib-src/ntlib.c (sys_mkdir, sys_open): New functions.
      (mkostemp): Remove.
      
      * src/w32.c (mkostemp): Remove.
      (sys_mkdir): Accept a second (unused) argument.
      * src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT
      specific call to mkdir.  (Bug#28023)
      
      * nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine
      to accept 2 arguments.
      (open): Remove from "#ifdef emacs".
      * nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove.
      * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp)
      (OMIT_GNULIB_MODULE_tempname): Remove.
      8cc8ad02
  9. 15 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Remove unneeded stuff from nt/inc/sys/time.h · 3241c84f
      Eli Zaretskii authored
      * nt/inc/sys/time.h (_TIMEVAL_DEFINED, struct timevat, timerisset)
      (timercmp, timerclear): Don't define.  Instead, include the system
      header sys/time.h, and add only the interval timers stuff.  This
      avoids compiler warnings about 'gettimeofday's prototype, and also
      avoids redefinition of macros from system headers.
      3241c84f
  10. 14 May, 2017 2 commits
    • Eli Zaretskii's avatar
      Remove gettimeofday from w32 sources · 792ffa02
      Eli Zaretskii authored
      * lib-src/ntlib.c (gettimeofday):
      * nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused
      function 'gettimeofday' and all of its supporting code.
      792ffa02
    • Eli Zaretskii's avatar
      Fix the MS-Windows build · 3af6909f
      Eli Zaretskii authored
      * nt/inc/sys/time.h (gettimeofday):
      * src/w32.c (gettimeofday): Adjust signature to match Gnulib.
      3af6909f
  11. 04 May, 2017 1 commit
  12. 02 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Temporary fix for the MS_Windows build · b7c5af2b
      Eli Zaretskii authored
      * nt/inc/ms-w32.h (WIN32_LEAN_AND_MEAN): Define to an empty value,
      to be consistent with Gnulib's utimens.c.  This is because utimens.c
      unconditionally defines WIN32_LEAN_AND_MEAN to an empty value, so the
      previous definition here conflicted with that.
      b7c5af2b
  13. 01 Jan, 2017 2 commits
  14. 19 Nov, 2016 1 commit
    • Eli Zaretskii's avatar
      Implement getrlimit and setrlimit for MS-Windows · 4cdd14ea
      Eli Zaretskii authored
      * src/w32heap.c (getrlimit, setrlimit): New functions.
      Include w32.h.
      * src/emacs.c (main): Use 'rlim_t', not 'long', for values that
      should be compatible with 'struct rlimit' members.
      
      * nt/inc/sys/resource.h: New header file.
      
      * nt/mingw-cfg.site (ac_cv_func_getrlimit, ac_cv_func_setrlimit):
      Set to "yes".
      4cdd14ea
  15. 06 Oct, 2016 2 commits
    • Eli Zaretskii's avatar
      Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2 · d48369db
      Eli Zaretskii authored
      * nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before
      defining to avoid redefinition warnings.
      
      * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid
      inclusion of sys/stat.h from the system headers, which could then
      lead to compilation errors due to redefinition of 'struct stat'
      etc.  This is needed because latest versions of MinGW runtime
      include sys/stat.h from wchar.h.
      
      * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily
      redefine to 4 to avoid conflict between 2 definitions of
      MemoryBarrier.  (Bug#24613)
      d48369db
    • Eli Zaretskii's avatar
      Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2 · 34b6df19
      Eli Zaretskii authored
      * nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before
      defining to avoid redefinition warnings.
      
      * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid
      inclusion of sys/stat.h from the system headers, which could then
      lead to compilation errors due to redefinition of 'struct stat'
      etc.  This is needed because latest versions of MinGW runtime
      include sys/stat.h from wchar.h.
      
      * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily
      redefine to 4 to avoid conflict between 2 definitions of
      MemoryBarrier.  (Bug#24613)
      
      Do not merge to master!
      34b6df19
  16. 01 Sep, 2016 2 commits
  17. 22 Jul, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compilation warning in the MinGW build · d0e1774a
      Eli Zaretskii authored
      * nt/inc/ms-w32.h: Include stdint.h.
      (_execvp, execve): Provide prototypes.
      
      * lib-src/emacsclient.c [WINDOWSNT]: Remove prototype for execvp,
      it is now in nt/inc/ms-w32.h.
      * lib-src/ntlib.c (getppid): Avoid compiler warnings due to format
      mismatch.
      (sys_ctime): Remove, not used.
      d0e1774a
  18. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  19. 06 Mar, 2016 1 commit
  20. 05 Mar, 2016 1 commit
    • Eli Zaretskii's avatar
      Implement getaddrinfo fallback for MS-Windows · bc96f6e8
      Eli Zaretskii authored
      See http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg01602.html
      for more details.
      
      * nt/mingw-cfg.site (ac_cv_func_getaddrinfo)
      (ac_cv_func_gai_strerror): Set to "yes", as the configure script's
      test program is not smart enough to auto-detect these.
      * nt/inc/sys/socket.h (getaddrinfo, freeaddrinfo): Redirect to
      sys_getaddrinfo and sys_freeaddrinfo.  Provide prototypes for
      sys_getaddrinfo and sys_freeaddrinfo.
      
      * src/w32.c (init_winsock): Try loading getaddrinfo and
      freeaddrinfo from ws2_32.dll.
      (sys_getaddrinfo, sys_freeaddrinfo): New functions.
      
      * lib-src/pop.c [WINDOWSNT]: Include winsock2.h, not winsock.h,
      and also ws2tcpip.h.
      (getaddrinfo, freeaddrinfo) [WINDOWSNT]: Redirect to
      sys_getaddrinfo and sys_freeaddrinfo, respectively.
      (load_ws2, sys_getaddrinfo, sys_freeaddrinfo) [WINDOWSNT]: New
      functions.
      bc96f6e8
  21. 16 Jan, 2016 1 commit
  22. 01 Jan, 2016 1 commit
  23. 02 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix the MS-Windows build · 470e3028
      Eli Zaretskii authored
      * src/thread.h [WINDOWSNT]: Include sys/socket.h.
      
      * src/sysselect.h: Don't define fd_set and FD_* macros for
      MS-Windows here.
      * src/w32.h: Define them here.
      
      * src/process.h (sys_select): Declare prototype.
      
      * src/sysdep.c:
      * src/process.c:
      * src/filelock.c:
      * src/emacs.c:
      * src/callproc.c: Move inclusion of sys/select.h after lisp.h.
      * nt/inc/socket.h: Include w32.h instead of sysselect.h
      470e3028
  24. 08 Aug, 2015 1 commit
    • Eli Zaretskii's avatar
      Support recovery from C stack overflow on MS-Windows · 7afa4f30
      Eli Zaretskii authored
      * src/w32fns.c (w32_reset_stack_overflow_guard)
      (stack_overflow_handler): New functions for handling C stack
      overflow exceptions.
      (my_exception_handler): Handle EXCEPTION_STACK_OVERFLOW exceptions
      specially, and zero out except_addr if we do.
      (globals_of_w32fns): Initialize dwMainThreadId in non-interactive
      mode.
      * src/sysdep.c [HAVE_STACK_OVERFLOW_HANDLING]: Add !WINDOWSNT to
      the condition, as HAVE_STACK_OVERFLOW_HANDLING is now defined for
      the MinGW build, but the code guarded by that is for Posix hosts.
      * src/keyboard.c (command_loop) [WINDOWSNT]: Call
      w32_reset_stack_overflow_guard.
      
      * nt/inc/ms-w32.h (sigjmp_buf): New typedef.
      (sigsetjmp): New macro.
      (w32_reset_stack_overflow_guard): Declare the prototype.
      
      * configure.ac (HAVE_STACK_OVERFLOW_HANDLING): Set to 1 for MinGW.
      7afa4f30
  25. 27 Jul, 2015 1 commit
    • Eli Zaretskii's avatar
      MS-Windows follow-up for recent TZ-related changes · 70096743
      Eli Zaretskii authored
      * nt/mingw-cfg.site (ac_cv_header_pthread_h)
      (gl_cv_sys_struct_timespec_in_pthread_h): Force to "no", to avoid
      picking up 'struct timespec' from pthread.h, if it is installed on
      the user's system.  We want either the definitions from MinGW
      system headers, if available, or the Gnulib replacements if not.
      
      * nt/inc/ms-w32.h <struct timespec>: Don't define, as we now use
      lib/time.h.
      
      * lib/time.in.h: Don't let __need_* symbols affect what happens on
      MinGW.  These symbols are defined by MinGW system headers, but we
      don't want that to affect whether Gnulib portions of the header
      are or aren't used.
      70096743
  26. 07 Jun, 2015 1 commit
  27. 27 Mar, 2015 1 commit
    • Eli Zaretskii's avatar
      Support non-blocking connect on MS-Windows (Bug#20207) · d133cf83
      Eli Zaretskii authored
       Based on ideas from Kim F. Storm <storm@cua.dk>, see
       http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html.
      
       src/w32proc.c (reader_thread): If the FILE_CONNECT flag is set, call
       '_sys_wait_connect'.  If it returns STATUS_CONNECT_FAILED, exit
       the thread with code 2.
       (sys_select): Support 'wfds' in addition to 'rfds'.  If a
       descriptor in 'wfds' has its bit set, but the corresponding
       fd_info member doesn't have its FILE_CONNECT flag set, ignore the
       descriptor.  Otherwise, acknowledge a successful non-blocking
       connect by resetting the FILE_CONNECT flag and setting cp->status
       to STATUS_READ_ACKNOWLEDGED.
       src/w32.h (STATUS_CONNECT_FAILED): New enumeration value.
       (struct _child_process): New member 'errcode'.
       (FILE_CONNECT): New flag.
       (_sys_wait_connect): Add prototype.
       src/w32.c (pfn_WSAEnumNetworkEvents): New function pointer.
       (init_winsock): Load WSAEnumNetworkEvents from winsock DLL.
       (set_errno): Map WSAEWOULDBLOCK and WSAENOTCONN.
       (sys_connect): Support non-blocking 'connect' calls by setting the
       FILE_CONNECT flag in the fd_info member and returning EINPROGRESS.
       (_sys_read_ahead): Add debug message if this function is called
       for a descriptor that waits for a non-blocking connect to complete.
       (_sys_wait_connect): New function.
       (sys_read): Support STATUS_CONNECT_FAILED.  Return the error code
       recorded by _sys_wait_connect when the non-blocking connect
       failed.  Don't call WSAGetLastError before a call to set_errno had
       a chance to use its value, since WSAGetLastError clears the last
       error.
      
       nt/inc/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Don't define.
      d133cf83
  28. 27 Feb, 2015 1 commit
    • Mark Laws's avatar
      Support daemon mode on MS-Windows (bug#19688) · 805fe507
      Mark Laws authored
       src/emacs.c <w32_daemon_event> [WINDOWSNT]: New global var.
       (main) [WINDOWSNT]: Initialize it to NULL.  Create the event to
       signal clients we are ready for connections.
       (Fdaemon_initialized): Use DAEMON_RUNNING.
       [WINDOWSNT]: MS-Windows specific code to signal clients we are
       ready for connections.
       src/lisp.h (DAEMON_RUNNING): New macro, encapsulates Posix and
       MS-Windows conditions for running in daemon mode.
       src/minibuf.c (read_minibuf): Use DAEMON_RUNNING.
       src/keyboard.c (kbd_buffer_get_event): Use DAEMON_RUNNING.
       src/dispnew.c (init_display) [WINDOWSNT]: Initialize frames/terminal
       even in daemon mode.
      
       nt/inc/ms-w32.h (W32_DAEMON_EVENT): New macro.
      
       lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Don't reject empty
       arguments for --alternate-editor.
       (print_help_and_exit) [WINDOWSNT]: Don't refrain from advertising
       empty arguments for --alternate-editor.
       (start_daemon_and_retry_set_socket) [WINDOWSNT]: MS-Windows
       specific code to start Emacs in daemon mode and wait for it to be
       ready for client connections.
      
       lisp/server.el (server-process-filter): Force GUI frames on
       MS-Windows in daemon mode, even if a TTY frame was requested.
       lisp/frameset.el (frameset-keep-original-display-p): Don't assume
       windows-nt cannot be in daemon mode.
       lisp/frame.el (window-system-for-display): Don't assume windows-nt
       cannot be in daemon mode.
      805fe507
  29. 01 Jan, 2015 2 commits
  30. 17 Nov, 2014 1 commit
    • Oscar Fuentes's avatar
      Define MINGW_W64 and use it instead of _W64 · 81e0cca7
      Oscar Fuentes authored
      ... for detecting MinGW-w64. _W64 is not specific of MinGW-w64, it is
      defined for compatibility with MS VC++.
      
      	* nt/inc/ms-w32.h: Define MINGW_W64.
      
      	* admin/CPP-DEFINES: Mention MINGW_W64.
      
      	* nt/addpm.c: Use it.
      
      	* nt/addsection.c: Use it.
      
      	* nt/preprep.c: Use it.
      
      	* src/w32.c: Use MINGW_W64 instead of _W64
      
      	* src/w32term.c: Likewise.
      81e0cca7
  31. 05 Jun, 2014 1 commit
  32. 27 May, 2014 1 commit
    • Fabrice Popineau's avatar
      Use mmap(2) emulation for buffer text on MS-Windows. · 587fd086
      Fabrice Popineau authored
       src/Makefile.in (C_HEAP_SWITCH): Get the predefined heap size from
       configure.
       (ADDSECTION, MINGW_TEMACS_POST_LINK): Remove, no longer used.
       src/lisp.h (NONPOINTER_BITS): Modify the condition to define to zero
       for MinGW, since it no longer uses gmalloc.
       src/buffer.c: Do not define mmap allocations functions for Windows.
       Remove mmap_find which is unused. Remove mmap_set_vars which does
       nothing useful.
       [WINDOWSNT]: Include w32heap.h.
       (init_buffer): Always allocate new memory for buffers.
       src/emacs.c: Remove mmap_set_vars calls.
       src/image.c (free_image): Undef free for Windows because it is
       redirected to our private version.
       src/unexw32.c (COPY_PROC_CHUNK): Use %p format for 64bits
       compatibility.
       (copy_executable_and_dump_data): Remove dumping the heap section.
       (unexec): Restore using_dynamic_heap after dumping.
       src/w32heap.c (dumped_data_commit, malloc_after_dump)
       (malloc_before_dump, realloc_after_dump, realloc_before_dump)
       (free_after_dump, free_before_dump, mmap_alloc, mmap_realloc)
       (mmap_free): New functions.
       src/w32heap.h: Declare dumped_data and mmap_* function prototypes.
      
       nt/inc/ms-w32.h: Switch to the system heap allocation scheme
       instead of GNU malloc and ralloc.
       nt/inc/sys/mman.h: New file.
       nt/INSTALL: Update for the new build requirements.
      
       etc/NEWS: Mention build changes on MS-Windows.
      
       configure.ac (C_HEAP_SWITCH) define for different values of
       dumped heap size depending on 32/64bits arch on Windows.
       Don't check for pthreads.h on MinGW32/64, it gets in the way.
       Use mmap(2) for buffers and system malloc for MinGW32/64.
      587fd086
  33. 21 Apr, 2014 1 commit
  34. 11 Jan, 2014 1 commit