Mercurial > hg > octave-nkf > gnulib-hg
changeset 15596:37c7cad1b0d9
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.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 11 Sep 2011 18:14:00 +0200 |
parents | 328819af1c02 |
children | 1fda2cd7d7d3 |
files | ChangeLog doc/posix-headers/sys_types.texi lib/sys_types.in.h m4/sys_types_h.m4 modules/sys_types |
diffstat | 5 files changed, 115 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-09-11 Bruno Haible <bruno@clisp.org> + + 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 <bruno@clisp.org> Support for MSVC compiler: Avoid division by a literal 0.
--- 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
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 <stddef.h>, not in <sys/types.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <stddef.h> +#endif + +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
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], +[ +])
new file mode 100644 --- /dev/null +++ b/modules/sys_types @@ -0,0 +1,41 @@ +Description: +A <sys/types.h> 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 <sys/types.h> 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: +<sys/types.h> + +License: +LGPLv2+ + +Maintainer: +all