# HG changeset patch # User Bruno Haible # Date 1315757640 -7200 # Node ID 37c7cad1b0d97fd3c49433489825a727ed991ff6 # Parent 328819af1c029f0d103d370310509ddc9e69838e New module 'sys_types'. * lib/sys_types.in.h: New file. * m4/sys_types_h.m4: New file. * modules/sys_types: New file. * doc/posix-headers/sys_types.texi: Mention the new module and the size_t problem on MSVC 9. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-09-11 Bruno Haible + + New module 'sys_types'. + * lib/sys_types.in.h: New file. + * m4/sys_types_h.m4: New file. + * modules/sys_types: New file. + * doc/posix-headers/sys_types.texi: Mention the new module and the + size_t problem on MSVC 9. + 2011-09-11 Bruno Haible Support for MSVC compiler: Avoid division by a literal 0. diff --git a/doc/posix-headers/sys_types.texi b/doc/posix-headers/sys_types.texi --- a/doc/posix-headers/sys_types.texi +++ b/doc/posix-headers/sys_types.texi @@ -3,16 +3,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html} -Gnulib module: --- +Gnulib module: sys_types Portability problems fixed by Gnulib: @itemize +@item +The type @code{pid_t} is not defined on some platforms: +MSVC 9. +@item +The type @code{size_t} is not defined in this file on some platforms: +MSVC 9. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -The type @code{pid_t} is not defined on some platforms: -MSVC 9. -You can use the macro @code{AC_TYPE_PID_T} to fix this. @end itemize diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h new file mode 100644 --- /dev/null +++ b/lib/sys_types.in.h @@ -0,0 +1,40 @@ +/* Provide a more complete sys/time.h. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program 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 2, or (at your option) + any later version. + + This program 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 this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@ + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H +#define _@GUARD_PREFIX@_SYS_TYPES_H + +/* MSVC 9 defines size_t in , not in . */ +/* But avoid namespace pollution on glibc systems. */ +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include +#endif + +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4 new file mode 100644 --- /dev/null +++ b/m4/sys_types_h.m4 @@ -0,0 +1,18 @@ +# sys_types_h.m4 serial 1 +dnl Copyright (C) 2011 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. + +AC_DEFUN([gl_SYS_TYPES_H], +[ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + gl_NEXT_HEADERS([sys/types.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) +]) + +AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], +[ +]) diff --git a/modules/sys_types b/modules/sys_types new file mode 100644 --- /dev/null +++ b/modules/sys_types @@ -0,0 +1,41 @@ +Description: +A that conforms better to POSIX. + +Files: +lib/sys_types.in.h +m4/sys_types_h.m4 + +Depends-on: +include_next + +configure.ac: +gl_SYS_TYPES_H +AC_PROG_MKDIR_P + +Makefile.am: +BUILT_SOURCES += sys/types.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|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_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + < $(srcdir)/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/types.h sys/types.h-t + +Include: + + +License: +LGPLv2+ + +Maintainer: +all