bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] unistd_h: make it easier to avoid sys_types_h


From: Paul Eggert
Subject: [PATCH] unistd_h: make it easier to avoid sys_types_h
Date: Fri, 04 May 2012 13:07:04 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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.
diff --git a/m4/off_t.m4 b/m4/off_t.m4
new file mode 100644
index 0000000..207b946
--- /dev/null
+++ b/m4/off_t.m4
@@ -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])
+])
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index a14ba24..f11eef2 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -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],
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index d636caf..8b7830d 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -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.
diff --git a/modules/sys_types b/modules/sys_types
index ac0ca1d..2e9c427 100644
--- a/modules/sys_types
+++ b/modules/sys_types
@@ -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
diff --git a/modules/unistd b/modules/unistd
index 0d44412..7911506 100644
--- a/modules/unistd
+++ b/modules/unistd
@@ -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



reply via email to

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