[EMAIL PROTECTED] (Eric Blake) writes: >> With this, getopt actually do seem to compile and work in Visual >> Studio. Tested with the CLI in libtasn1, part of GnuTLS, with long >> options. >> >> I'll install this shortly unless someone protests. > > I'm not sure about this. Lately, the move has been to assume that > <unistd.h> exists, and this is a step backwards. What if, instead, > you provided a unistd_.h that got installed on platforms that are > lacking (so far, only MSVS comes to mind), then make modules > that unconditionally use <unistd.h> depend on a new unistd > module?
That sounds better. I've installed this. Index: ChangeLog =================================================================== RCS file: /sources/gnulib/gnulib/ChangeLog,v retrieving revision 1.503 diff -u -p -r1.503 ChangeLog --- ChangeLog 7 Mar 2006 13:17:11 -0000 1.503 +++ ChangeLog 7 Mar 2006 13:30:17 -0000 @@ -1,5 +1,11 @@ 2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * modules/getopt (Depends-on): Add unistd. + + * modules/unistd: New file. + +2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * modules/gc-random: New file. 2006-03-03 Simon Josefsson <[EMAIL PROTECTED]> Index: lib/ChangeLog =================================================================== RCS file: /sources/gnulib/gnulib/lib/ChangeLog,v retrieving revision 1.1111 diff -u -p -r1.1111 ChangeLog --- lib/ChangeLog 7 Mar 2006 13:17:10 -0000 1.1111 +++ lib/ChangeLog 7 Mar 2006 13:30:18 -0000 @@ -1,5 +1,9 @@ 2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * unistd_.h: New file. + +2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM. 2006-03-01 Simon Josefsson <[EMAIL PROTECTED]> Index: lib/unistd_.h =================================================================== RCS file: lib/unistd_.h diff -N lib/unistd_.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/unistd_.h 7 Mar 2006 13:30:18 -0000 @@ -0,0 +1,24 @@ +/* A unistd.h replacement for systems lacking it. + Copyright (C) 2006 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. */ + +/* Put any statements that are necessary to get a working unistd.h in + this file. */ + +/* MS Visual Studio doesn't have unistd.h, but it doesn't seem to need + any particular statements in this file. So this file is here to + avoid breaking '#include <unistd.h>' in other files. */ Index: m4/ChangeLog =================================================================== RCS file: /sources/gnulib/gnulib/m4/ChangeLog,v retrieving revision 1.792 diff -u -p -r1.792 ChangeLog --- m4/ChangeLog 7 Mar 2006 13:20:11 -0000 1.792 +++ m4/ChangeLog 7 Mar 2006 13:30:18 -0000 @@ -1,5 +1,9 @@ 2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * unistd_h.m4: New file. + +2006-03-07 Simon Josefsson <[EMAIL PROTECTED]> + * readline.m4 (gl_FUNC_READLINE): Rewrite the cached part of the test to be side-effect free by storing the result in the cache variable gl_cv_lib_readline, and moving the assignment of Index: modules/unistd =================================================================== RCS file: modules/unistd diff -N modules/unistd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/unistd 7 Mar 2006 13:30:18 -0000 @@ -0,0 +1,31 @@ +Description: +A <unistd.h> for systems lacking it. + +Files: +lib/unistd_.h +m4/unistd_h.m4 + +Depends-on: + +configure.ac: +gl_HEADER_UNISTD + +Makefile.am: +BUILT_SOURCES += $(UNISTD_H) +EXTRA_DIST += unistd_.h + +# We need the following in order to create <byteswap.h> when the system +# doesn't have one. +unistd.h: unistd_.h + cp $(srcdir)/unistd_.h [EMAIL PROTECTED] + mv [EMAIL PROTECTED] $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +Include: +#include <unistd.h> + +License: +LGPL + +Maintainer: +Simon Josefsson Index: modules/getopt =================================================================== RCS file: /sources/gnulib/gnulib/modules/getopt,v retrieving revision 1.9 diff -u -p -r1.9 getopt --- modules/getopt 22 Jul 2005 22:04:12 -0000 1.9 +++ modules/getopt 7 Mar 2006 13:30:18 -0000 @@ -10,6 +10,7 @@ m4/getopt.m4 Depends-on: gettext-h +unistd configure.ac: gl_GETOPT _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib