emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 615cec1: regex.h now includes sys/types.h


From: Paul Eggert
Subject: [Emacs-diffs] master 615cec1: regex.h now includes sys/types.h
Date: Sun, 25 Dec 2016 18:03:39 +0000 (UTC)

branch: master
commit 615cec1dfe9a808141096d20c763d89ed406e64d
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    regex.h now includes sys/types.h
    
    * src/dired.c, src/emacs.c, src/search.c, src/syntax.c, src/thread.h:
    Do not include sys/types.h; no longer needed.
    * src/regex.h: Include <sys/types.h>, as that's what Gnulib and
    glibc regex.h does, and POSIX has blessed this since 2008.
---
 src/dired.c  |    1 -
 src/emacs.c  |    1 -
 src/regex.h  |   14 ++++++--------
 src/search.c |    1 -
 src/syntax.c |    2 --
 src/thread.h |    1 -
 6 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/src/dired.c b/src/dired.c
index e468147..702917e 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -21,7 +21,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <config.h>
 
 #include <stdio.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 
 #ifdef HAVE_PWD_H
diff --git a/src/emacs.c b/src/emacs.c
index dc13b15..eff3f9d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -26,7 +26,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <sys/types.h>
 #include <sys/file.h>
 #include <unistd.h>
 
diff --git a/src/regex.h b/src/regex.h
index 2d720e6..4219943 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -27,14 +27,13 @@
 # error "_REGEX_RE_COMP nor _LIBC can be defined if emacs is defined."
 #endif
 
+#include <sys/types.h>
+
 /* Allow the use in C++ code.  */
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* POSIX says that <sys/types.h> must be included (by the caller) before
-   <regex.h>.  */
-
 #if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
    should be there.  */
@@ -430,11 +429,10 @@ struct re_pattern_buffer
 
 typedef struct re_pattern_buffer regex_t;
 
-/* Type for byte offsets within the string.  POSIX mandates this to be an int,
-   but the Open Group has signaled its intention to change the requirement to
-   be that regoff_t be at least as wide as ptrdiff_t and ssize_t.  Current
-   gnulib sources also use ssize_t, and we need this for supporting buffers and
-   strings > 2GB on 64-bit hosts.  */
+/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
+   ptrdiff_t and ssize_t.  We don't know of any hosts where ptrdiff_t
+   is wider than ssize_t, so ssize_t is safe.  ptrdiff_t is not
+   necessarily visible here, so use ssize_t.  */
 typedef ssize_t regoff_t;
 
 
diff --git a/src/search.c b/src/search.c
index 9d2c8cb..e499109 100644
--- a/src/search.c
+++ b/src/search.c
@@ -30,7 +30,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "blockinput.h"
 #include "intervals.h"
 
-#include <sys/types.h>
 #include "regex.h"
 
 #define REGEXP_CACHE_SIZE 20
diff --git a/src/syntax.c b/src/syntax.c
index 338dd85..7c15e77 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -20,8 +20,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
-#include <sys/types.h>
-
 #include "lisp.h"
 #include "character.h"
 #include "buffer.h"
diff --git a/src/thread.h b/src/thread.h
index 6d1af5c..9472ae3 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -19,7 +19,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #ifndef THREAD_H
 #define THREAD_H
 
-#include <sys/types.h>         /* for ssize_t used by regex.h */
 #include "regex.h"
 
 #ifdef WINDOWSNT



reply via email to

[Prev in Thread] Current Thread [Next in Thread]