diff options
Diffstat (limited to 'nt/inc')
-rw-r--r-- | nt/inc/grp.h | 7 | ||||
-rw-r--r-- | nt/inc/inttypes.h | 6 | ||||
-rw-r--r-- | nt/inc/langinfo.h | 7 | ||||
-rw-r--r-- | nt/inc/ms-w32.h | 31 | ||||
-rw-r--r-- | nt/inc/nl_types.h | 6 | ||||
-rw-r--r-- | nt/inc/stdint.h | 6 | ||||
-rw-r--r-- | nt/inc/sys/resource.h | 51 | ||||
-rw-r--r-- | nt/inc/sys/socket.h | 11 | ||||
-rw-r--r-- | nt/inc/sys/stat.h | 14 | ||||
-rw-r--r-- | nt/inc/sys/wait.h | 6 |
10 files changed, 116 insertions, 29 deletions
diff --git a/nt/inc/grp.h b/nt/inc/grp.h index 7d4e6fbbe2f..903fda9b3e5 100644 --- a/nt/inc/grp.h +++ b/nt/inc/grp.h @@ -1,13 +1,13 @@ /* Replacement grp.h file for building GNU Emacs on Windows. -Copyright (C) 2003-2015 Free Software Foundation, Inc. +Copyright (C) 2003-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. +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 @@ -34,4 +34,3 @@ extern unsigned getegid (void); extern struct group *getgrgid(gid_t); #endif /* _GRP_H */ - diff --git a/nt/inc/inttypes.h b/nt/inc/inttypes.h index a07d64e71ac..34d026c3e37 100644 --- a/nt/inc/inttypes.h +++ b/nt/inc/inttypes.h @@ -1,13 +1,13 @@ /* Replacement inttypes.h file for building GNU Emacs on Windows with MSVC. -Copyright (C) 2011-2015 Free Software Foundation, Inc. +Copyright (C) 2011-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. +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 diff --git a/nt/inc/langinfo.h b/nt/inc/langinfo.h index c9d2e6ed497..1532eaa4d1d 100644 --- a/nt/inc/langinfo.h +++ b/nt/inc/langinfo.h @@ -1,13 +1,13 @@ /* Replacement langinfo.h file for building GNU Emacs on Windows. -Copyright (C) 2006-2015 Free Software Foundation, Inc. +Copyright (C) 2006-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. +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 @@ -58,4 +58,3 @@ enum { extern char *nl_langinfo (nl_item); #endif /* _LANGINFO_H */ - diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index e7a94e81c2d..24076a31eeb 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -1,13 +1,13 @@ /* System description file for Windows NT. -Copyright (C) 1993-1995, 2001-2015 Free Software Foundation, Inc. +Copyright (C) 1993-1995, 2001-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. +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 @@ -146,6 +146,7 @@ extern char *getenv (); in its system headers, and is not really compatible with values lower than 0x0500, so leave it alone. */ #ifndef MINGW_W64 +# undef _WIN32_WINNT # define _WIN32_WINNT 0x0400 #endif @@ -185,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. */ @@ -284,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 @@ -457,6 +478,10 @@ extern void *malloc_after_dump(size_t); extern void *realloc_after_dump(void *, size_t); extern void free_after_dump(void *); +extern void *malloc_after_dump_9x(size_t); +extern void *realloc_after_dump_9x(void *, size_t); +extern void free_after_dump_9x(void *); + extern malloc_fn the_malloc_fn; extern realloc_fn the_realloc_fn; extern free_fn the_free_fn; diff --git a/nt/inc/nl_types.h b/nt/inc/nl_types.h index 86772b6d8dd..e4d314ceedd 100644 --- a/nt/inc/nl_types.h +++ b/nt/inc/nl_types.h @@ -1,13 +1,13 @@ /* Replacement nl_types.h file for building GNU Emacs on Windows. -Copyright (C) 2006-2015 Free Software Foundation, Inc. +Copyright (C) 2006-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. +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 diff --git a/nt/inc/stdint.h b/nt/inc/stdint.h index 43c4be1b5c6..bb067f4418a 100644 --- a/nt/inc/stdint.h +++ b/nt/inc/stdint.h @@ -1,13 +1,13 @@ /* Replacement stdint.h file for building GNU Emacs on Windows. -Copyright (C) 2011-2015 Free Software Foundation, Inc. +Copyright (C) 2011-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. +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 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 067effe929e..e9a021a5038 100644 --- a/nt/inc/sys/socket.h +++ b/nt/inc/sys/socket.h @@ -1,11 +1,11 @@ -/* Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2001-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. +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 @@ -99,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); @@ -119,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/inc/sys/stat.h b/nt/inc/sys/stat.h index 9b493539450..ea14f075471 100644 --- a/nt/inc/sys/stat.h +++ b/nt/inc/sys/stat.h @@ -1,14 +1,14 @@ /* sys/stat.h supplied with MSVCRT uses too narrow data types for inode and user/group id, so we replace them with our own. -Copyright (C) 2008-2015 Free Software Foundation, Inc. +Copyright (C) 2008-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. +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 @@ -30,6 +30,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ # define __MINGW_NOTHROW #endif +/* Prevent the MinGW stat.h header from being included, ever. */ +#ifndef _SYS_STAT_H +# define _SYS_STAT_H +#endif +#ifndef _INC_STAT_H +# define _INC_STAT_H +#endif + #include <sys/types.h> #include <time.h> diff --git a/nt/inc/sys/wait.h b/nt/inc/sys/wait.h index 8f9628f1553..46dae494997 100644 --- a/nt/inc/sys/wait.h +++ b/nt/inc/sys/wait.h @@ -1,13 +1,13 @@ /* A limited emulation of sys/wait.h on Posix systems. -Copyright (C) 2012-2015 Free Software Foundation, Inc. +Copyright (C) 2012-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. +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 |