]> Savannah Git Hosting - gnulib.git/commitdiff
unistd_h: make it easier to avoid sys_types_h
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 May 2012 20:05:31 +0000 (13:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 May 2012 20:06:00 +0000 (13:06 -0700)
This is useful for Emacs, which has its own method of porting to
Windows, and which therefore does not need the sys_types_h module.
* m4/off_t.m4: New file, defining gl_TYPE_OFF_T, which contains
code moved here from gl_SYS_TYPES_H.
* m4/sys_types_h.m4 (gl_SYS_TYPES_H): Require it instead of
using the code directly.
* m4/unistd_h.m4 (gl_UNISTD_H): Require gl_TYPE_OFF_T, not
gl_SYS_TYPES_H.
* modules/sys_types (Files):
* modules/unistd (Files): Add m4/off_t.m4.

ChangeLog
m4/off_t.m4 [new file with mode: 0644]
m4/sys_types_h.m4
m4/unistd_h.m4
modules/sys_types
modules/unistd

index ca2f6c4de2f2c13149d44ed5f31a74b02339b999..3705d3318eda85d9c14746cd7fc296d0916c4353 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       unistd_h: make it easier to avoid sys_types_h
+       This is useful for Emacs, which has its own method of porting to
+       Windows, and which therefore does not need the sys_types_h module.
+       * m4/off_t.m4: New file, defining gl_TYPE_OFF_T, which contains
+       code moved here from gl_SYS_TYPES_H.
+       * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Require it instead of
+       using the code directly.
+       * m4/unistd_h.m4 (gl_UNISTD_H): Require gl_TYPE_OFF_T, not
+       gl_SYS_TYPES_H.
+       * modules/sys_types (Files):
+       * modules/unistd (Files): Add m4/off_t.m4.
+
 2012-05-03  Bruno Haible  <bruno@clisp.org>
 
        lstat: Avoid "guessing no" when cross-compiling to glibc systems.
diff --git a/m4/off_t.m4 b/m4/off_t.m4
new file mode 100644 (file)
index 0000000..207b946
--- /dev/null
@@ -0,0 +1,17 @@
+# off_t.m4
+dnl Copyright (C) 2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether to override the 'off_t' type.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+  m4_ifdef([gl_LARGEFILE], [
+    AC_REQUIRE([gl_LARGEFILE])
+  ], [
+    WINDOWS_64_BIT_OFF_T=0
+  ])
+  AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
index a14ba24470763b81a73f169223d4140c666e1e66..f11eef2fe8a1474ee76de148a4114de6751314a6 100644 (file)
@@ -1,4 +1,4 @@
-# sys_types_h.m4 serial 3
+# sys_types_h.m4 serial 4
 dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,12 +16,7 @@ AC_DEFUN([gl_SYS_TYPES_H],
   AC_REQUIRE([AC_TYPE_MODE_T])
 
   dnl Whether to override the 'off_t' type.
-  m4_ifdef([gl_LARGEFILE], [
-    AC_REQUIRE([gl_LARGEFILE])
-  ], [
-    WINDOWS_64_BIT_OFF_T=0
-  ])
-  AC_SUBST([WINDOWS_64_BIT_OFF_T])
+  AC_REQUIRE([gl_TYPE_OFF_T])
 ])
 
 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
index d636caf112464b996701ddab23425d0cf67617ad..8b7830da3e97998c6f5f8387b8f7463fa1f91fb1 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 64
+# unistd_h.m4 serial 65
 dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,8 +24,8 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Ensure the type pid_t gets defined.
   AC_REQUIRE([AC_TYPE_PID_T])
 
-  dnl Determine WINDOWS_64_BIT_OFF_T.
-  AC_REQUIRE([gl_SYS_TYPES_H])
+  dnl Whether to override the 'off_t' type.
+  AC_REQUIRE([gl_TYPE_OFF_T])
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
index ac0ca1daf400d5cebbb6c7bd67043c9c7e7b6268..2e9c4278674bfc6e688845677aad49352ad35593 100644 (file)
@@ -4,6 +4,7 @@ A <sys/types.h> that conforms better to POSIX.
 Files:
 lib/sys_types.in.h
 m4/sys_types_h.m4
+m4/off_t.m4
 
 Depends-on:
 include_next
index 0d444126d9e71872b9b57788cf908740f467b05a..79115063c3a6e88cf850533219d91c0587b7b7c3 100644 (file)
@@ -4,6 +4,7 @@ A GNU-like <unistd.h>.
 Files:
 m4/unistd_h.m4
 lib/unistd.in.h
+m4/off_t.m4
 
 Depends-on:
 include_next