summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
Diffstat (limited to 'nt')
-rw-r--r--nt/Makefile.in13
-rw-r--r--nt/gnulib.mk42
-rw-r--r--nt/inc/ms-w32.h20
-rw-r--r--nt/inc/sys/resource.h51
-rw-r--r--nt/inc/sys/socket.h5
-rw-r--r--nt/mingw-cfg.site16
-rw-r--r--nt/runemacs.c2
7 files changed, 144 insertions, 5 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/gnulib.mk b/nt/gnulib.mk
index 6884bf9f077..65b206e2fac 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,6 +334,14 @@ 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
@@ -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..6b9f56f917c 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -98,6 +98,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 +120,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