diff options
Diffstat (limited to 'nt')
-rw-r--r-- | nt/Makefile.in | 13 | ||||
-rw-r--r-- | nt/README.W32 | 2 | ||||
-rw-r--r-- | nt/addpm.c | 5 | ||||
-rw-r--r-- | nt/cmdproxy.c | 32 | ||||
-rw-r--r-- | nt/ddeclient.c | 3 | ||||
-rw-r--r-- | nt/gnulib.mk | 44 | ||||
-rw-r--r-- | nt/inc/ms-w32.h | 20 | ||||
-rw-r--r-- | nt/inc/sys/resource.h | 51 | ||||
-rw-r--r-- | nt/inc/sys/socket.h | 6 | ||||
-rw-r--r-- | nt/mingw-cfg.site | 16 | ||||
-rw-r--r-- | nt/runemacs.c | 2 |
11 files changed, 176 insertions, 18 deletions
diff --git a/nt/Makefile.in b/nt/Makefile.in index 2b528aa4bdf..28060febadd 100644 --- a/nt/Makefile.in +++ b/nt/Makefile.in @@ -225,9 +225,18 @@ extraclean: maintainer-clean check: @echo "We don't have any tests for the nt/ directory yet." +ETAGS = ../lib-src/etags${EXEEXT} + +${ETAGS}: FORCE + ${MAKE} -C ../lib-src $(notdir $@) + +tagsfiles= $(wildcard ${srcdir}/*.[ch]) + +FORCE: +.PHONY: tags FORCE tags: TAGS -TAGS: ${EXE_FILES:${EXEEXT}=.c} - ../lib-src/etags *.[ch] +TAGS: ${ETAGS} ${tagsfiles} + ${ETAGS} ${tagsfiles} ## Build the programs addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h diff --git a/nt/README.W32 b/nt/README.W32 index 73b96b39494..9bc8f87496e 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2016 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 25.1.91 for MS-Windows + Emacs version 25.1.50 for MS-Windows This README file describes how to set up and run a precompiled distribution of the latest version of GNU Emacs for MS-Windows. You diff --git a/nt/addpm.c b/nt/addpm.c index 2161ea786bd..14a77d57498 100644 --- a/nt/addpm.c +++ b/nt/addpm.c @@ -53,6 +53,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "../src/epaths.h" #endif +HDDEDATA CALLBACK DdeCallback (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, + DWORD); + HDDEDATA CALLBACK DdeCallback (UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, @@ -101,7 +104,7 @@ env_vars[] = #endif }; -void +static void add_registry (const char *path) { HKEY hrootkey = NULL; diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index 411a409baca..d0298da36b9 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c @@ -46,6 +46,16 @@ extern int _snprintf (char *buffer, size_t count, const char *format, ...); #define stdout GetStdHandle (STD_OUTPUT_HANDLE) #define stderr GetStdHandle (STD_ERROR_HANDLE) +#if __GNUC__ + (__GNUC_MINOR__ >= 4) >= 5 +void fail (const char *, ...) __attribute__((noreturn)); +#else +void fail (const char *, ...); +#endif +int vfprintf (HANDLE, const char *, va_list); +int fprintf (HANDLE, const char *, ...); +int printf (const char *, ...); +void warn (const char *, ...); + int vfprintf (HANDLE hnd, const char * msg, va_list args) { @@ -106,7 +116,7 @@ warn (const char * msg, ...) /******************************************************************/ -char * +static char * canon_filename (char *fname) { char *p = fname; @@ -121,14 +131,14 @@ canon_filename (char *fname) return fname; } -const char * +static const char * skip_space (const char *str) { while (isspace (*str)) str++; return str; } -const char * +static const char * skip_nonspace (const char *str) { while (*str && !isspace (*str)) str++; @@ -141,7 +151,7 @@ skip_nonspace (const char *str) const int escape_char = '\\'; /* Get next token from input, advancing pointer. */ -int +static int get_next_token (char * buf, const char ** pSrc) { const char * p = *pSrc; @@ -244,7 +254,7 @@ get_next_token (char * buf, const char ** pSrc) } /* Return TRUE if PROGNAME is a batch file. */ -BOOL +static BOOL batch_file_p (const char *progname) { const char *exts[] = {".bat", ".cmd"}; @@ -267,7 +277,7 @@ batch_file_p (const char *progname) /* Search for EXEC file in DIR. If EXEC does not have an extension, DIR is searched for EXEC with the standard extensions appended. */ -int +static int search_dir (const char *dir, const char *exec, int bufsize, char *buffer) { const char *exts[] = {".bat", ".cmd", ".exe", ".com"}; @@ -320,7 +330,7 @@ search_dir (const char *dir, const char *exec, int bufsize, char *buffer) /* Return the absolute name of executable file PROG, including any file extensions. If an absolute name for PROG cannot be found, return NULL. */ -char * +static char * make_absolute (const char *prog) { char absname[MAX_PATH]; @@ -393,7 +403,7 @@ make_absolute (const char *prog) success, return 1 with cmdline dequoted. Otherwise, when we've found constructs only cmd can properly interpret, return 0 and leave cmdline unchanged. */ -int +static int try_dequote_cmdline (char* cmdline) { /* Dequoting can only subtract characters, so the length of the @@ -491,6 +501,8 @@ setup_argv (void) PROCESS_INFORMATION child; int interactive = TRUE; +BOOL console_event_handler (DWORD); + BOOL console_event_handler (DWORD event) { @@ -527,7 +539,7 @@ console_event_handler (DWORD event) /* Change from normal usage; return value indicates whether spawn succeeded or failed - program return code is returned separately. */ -int +static int spawn (const char *progname, char *cmdline, const char *dir, int *retcode) { BOOL success = FALSE; @@ -572,7 +584,7 @@ spawn (const char *progname, char *cmdline, const char *dir, int *retcode) } /* Return size of current environment block. */ -int +static int get_env_size (void) { char * start = GetEnvironmentStrings (); diff --git a/nt/ddeclient.c b/nt/ddeclient.c index 7bbbdb0f48b..a9ad6d6bba0 100644 --- a/nt/ddeclient.c +++ b/nt/ddeclient.c @@ -21,6 +21,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <stdio.h> +HDDEDATA CALLBACK DdeCallback (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, + DWORD); + HDDEDATA CALLBACK DdeCallback (UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, diff --git a/nt/gnulib.mk b/nt/gnulib.mk index 6884bf9f077..6d9fbcf0254 100644 --- a/nt/gnulib.mk +++ b/nt/gnulib.mk @@ -1,4 +1,4 @@ -## This file is an edited copy if ../lib/gnulib.mk. +## This file is an edited copy of ../lib/gnulib.mk. ## ## The purpose of the edits is to avoid generating any headers ## which would conflict with either the headers we have in nt/inc, @@ -43,7 +43,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=flexmember --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=unsetenv --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings +# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=flexmember --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=unsetenv --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings MOSTLYCLEANFILES += core *.stackdump @@ -334,10 +334,18 @@ EXTRA_DIST += filemode.h ## end gnulib module filemode +## begin gnulib module filevercmp + +libgnu_a_SOURCES += filevercmp.c + +EXTRA_DIST += filevercmp.h + +## end gnulib module filevercmp + ## begin gnulib module fpending -EXTRA_DIST += fpending.c fpending.h +EXTRA_DIST += fpending.c fpending.h stdio-impl.h EXTRA_libgnu_a_SOURCES += fpending.c @@ -467,6 +475,34 @@ EXTRA_DIST += intprops.h ## end gnulib module intprops +## begin gnulib module limits-h + +BUILT_SOURCES += $(LIMITS_H) + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +if GL_GENERATE_LIMITS_H +limits.h: limits.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ + < $(srcdir)/limits.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +limits.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += limits.h limits.h-t + +EXTRA_DIST += limits.in.h + +## end gnulib module limits-h + ## begin gnulib module lstat @@ -762,6 +798,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -1082,6 +1119,7 @@ EXTRA_DIST += utimens.h ## begin gnulib module verify + EXTRA_DIST += verify.h ## end gnulib module verify diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index b4eb5622242..24076a31eeb 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -186,6 +186,13 @@ extern struct tm * sys_localtime (const time_t *); supply the 2nd arg correctly, so don't use _setjmp directly in that case. */ #undef HAVE__SETJMP + +/* Unlike MS and mingw.org, MinGW64 doesn't define gai_strerror as an + inline function in a system header file, and instead seems to + require to link against ws2_32.a. But we don't want to link with + -lws2_32, as that would make Emacs dependent on the respective DLL. + So MinGW64 is amply punished here by the following: */ +#undef HAVE_GAI_STRERROR #endif /* The following is needed for recovery from C stack overflows. */ @@ -285,6 +292,19 @@ extern int sys_umask (int); /* Map to MSVC names. */ #define execlp _execlp #define execvp _execvp +#include <stdint.h> /* for intptr_t */ +extern intptr_t _execvp (const char *, char **); +#ifdef MINGW_W64 +/* GCC 6 has a builtin execve with the prototype shown below. MinGW64 + changed the prototype in its process.h to match that, although the + library function still calls _execve, which still returns intptr_t. + However, using the prototype with intptr_t causes GCC to emit + warnings. Fortunately, execve is not used in the MinGW build, but + the code that references it is still compiled. */ +extern int execve (const char *, char * const *, char * const *); +#else +extern intptr_t execve (const char *, char * const *, char * const *); +#endif #define fdatasync _commit #define fdopen _fdopen #define fsync _commit diff --git a/nt/inc/sys/resource.h b/nt/inc/sys/resource.h new file mode 100644 index 00000000000..dfa0318cb40 --- /dev/null +++ b/nt/inc/sys/resource.h @@ -0,0 +1,51 @@ +/* A limited emulation of sys/resource.h. + +Copyright (C) 2016 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef INC_SYS_RESOURCE_H_ +#define INC_SYS_RESOURCE_H_ + +/* We only support RLIMIT_STACK and RLIMIT_NOFILE for now. */ +enum rlimit_resource { + RLIMIT_STACK = 0, +#define RLIMIT_STACK RLIMIT_STACK + + RLIMIT_NOFILE = 1, +#define RLIMIT_NOFILE RLIMIT_NOFILE + + RLIMIT_NLIMITS +#define RLIMIT_NLIMITS RLIMIT_NLIMITS +}; + +typedef enum rlimit_resource rlimit_resource_t; + +/* We use a 64-bit data type because some values could potentially be + 64-bit wide even in 32-bit builds. */ +typedef long long rlim_t; + +#define RLIMIT_INFINITY ((rlim_t) -1) + +struct rlimit { + rlim_t rlim_cur; /* current soft limit */ + rlim_t rlim_max; /* hard limit */ +}; + +extern int getrlimit (rlimit_resource_t, struct rlimit *); +extern int setrlimit (rlimit_resource_t, const struct rlimit *); + +#endif /* INC_SYS_RESOURCE_H_ */ diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h index ad40fc9a231..e9a021a5038 100644 --- a/nt/inc/sys/socket.h +++ b/nt/inc/sys/socket.h @@ -53,6 +53,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <ws2tcpip.h> /* process.c uses uint16_t (from C99) for IPv6, but apparently it is not defined in some versions of mingw and msvc. */ +#include <stdint.h> #ifndef UINT16_C typedef unsigned short uint16_t; #endif @@ -98,6 +99,8 @@ typedef unsigned short uint16_t; #define accept sys_accept #define recvfrom sys_recvfrom #define sendto sys_sendto +#define getaddrinfo sys_getaddrinfo +#define freeaddrinfo sys_freeaddrinfo int sys_socket(int af, int type, int protocol); int sys_bind (int s, const struct sockaddr *addr, int namelen); @@ -118,6 +121,9 @@ int sys_recvfrom (int s, char *buf, int len, int flags, struct sockaddr *from, int * fromlen); int sys_sendto (int s, const char * buf, int len, int flags, const struct sockaddr *to, int tolen); +int sys_getaddrinfo (const char * node, const char * service, + const struct addrinfo * hints, struct addrinfo ** res); +void sys_freeaddrinfo (struct addrinfo * ai); /* In addition to wrappers for the winsock functions, we also provide an fcntl function, for setting sockets to non-blocking mode. */ diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site index 05034fedd48..a1067179797 100644 --- a/nt/mingw-cfg.site +++ b/nt/mingw-cfg.site @@ -40,6 +40,12 @@ gl_cv_sys_struct_timespec_in_pthread_h=no # Or at all... ac_cv_header_pthread_h=no +# We don't want to check for these functions +# because they are implemented in libwinpthread. +ac_cv_search_clock_gettime="none required" +ac_cv_func_clock_gettime=no +ac_cv_func_clock_settime=no + # ACL functions are implemented in w32.c ac_cv_search_acl_get_file="none required" ac_cv_func_acl_get_file=yes @@ -68,6 +74,10 @@ ac_cv_func_getsockname=yes ac_cv_func_getpeername=yes # Implemented as sys_socket in w32.c ac_cv_func_socket=yes +# Implemented as sys_getaddrinfo in w32.c +ac_cv_func_getaddrinfo=yes +# Implemented as an inline function in ws2tcpip.h +ac_cv_func_gai_strerror=yes # Implemented in w32.c ac_cv_func_mkostemp=yes ac_cv_func_readlink=yes @@ -119,3 +129,9 @@ gl_cv_func_stat_file_slash=yes ac_cv_func_random=yes # Implemented in w32.c as sys_putenv gl_cv_func_svid_putenv=yes +# Implemented in w32heap.c +ac_cv_func_sbrk=yes +ac_cv_func_getrlimit=yes +ac_cv_func_setrlimit=yes +# GCC warnings that produce too much noise +gl_cv_warn_c__Wredundant_decls=no diff --git a/nt/runemacs.c b/nt/runemacs.c index b5e16c0304f..9edf148348e 100644 --- a/nt/runemacs.c +++ b/nt/runemacs.c @@ -203,7 +203,7 @@ void set_user_model_id (void) { HMODULE shell; - HRESULT (WINAPI * set_user_model) (wchar_t * id); + HRESULT (WINAPI * set_user_model) (const wchar_t * id); /* On Windows 7 and later, we need to set the user model ID to associate emacsclient launched files with Emacs frames |