www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/10/14:05:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 10 Jun 2004 14:03:46 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Dave Korn <dk AT artimi DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: xfce4 - xffm
In-Reply-To: <NUTMEGdiixjnzi95Hfq000002bf@NUTMEG.CAM.ARTIMI.COM>
Message-ID: <Pine.GSO.4.58.0406101354050.6113@slinky.cs.nyu.edu>
References: <NUTMEGdiixjnzi95Hfq000002bf AT NUTMEG DOT CAM DOT ARTIMI DOT COM>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Thu, 10 Jun 2004, Dave Korn wrote:

> > -----Original Message-----
> > From: Igor Pechtchanski
> > Sent: 10 June 2004 17:48
>
> > IMO, this is a bug in <mntent.h>.  There's no reason not to include
> > all the prerequisites, as include guards will take care of multiple
> > includes. It shouldn't require the users to include other headers
> > before it...
> >
> > Yes, I know, I know, PTC...
>
>   Don't think that this one should need an assign!
>
> --- mntent.old.h        2004-06-10 18:33:11.485938400 +0100
> +++ mntent.new.h        2004-06-10 18:35:13.501071300 +0100
> @@ -11,6 +11,10 @@ details. */
>  #ifndef _MNTENT_H
>  #define _MNTENT_H
>
> +#ifndef _STDIO_H_
> +#include <stdio.h> /* For FILE type. */
> +#endif
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> @@ -25,6 +29,7 @@ struct mntent
>    int mnt_passno;
>  };
>
> +
>  #ifndef _NOMNTENT_FUNCS
>  FILE *setmntent (const char *__filep, const char *__type);
>  struct mntent *getmntent (FILE *__filep);

The #ifdef/#endif just repeat the same test inside <stdio.h>.  It should
be possible to just include it.  The second hunk looks like a gratuitous
blank line...  And the include probably should go into the #if surrounding
the definition of all those functions.  In other words,

Index: winsup/cygwin/include/mntent.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/mntent.h,v
retrieving revision 1.3
diff -u -p -r1.3 mntent.h
--- winsup/cygwin/include/mntent.h      5 Mar 2001 21:29:20 -0000       1.3
+++ winsup/cygwin/include/mntent.h      10 Jun 2004 18:01:54 -0000
@@ -26,6 +26,8 @@ struct mntent
 };

 #ifndef _NOMNTENT_FUNCS
+#include <stdio.h>  /* For FILE type. */
+
 FILE *setmntent (const char *__filep, const char *__type);
 struct mntent *getmntent (FILE *__filep);
 int addmntent (FILE *__filep, const struct mntent *__mnt);

should suffice.  Oh, and your patch won't apply (wrong destination file)
and is missing a ChangeLog (so is mine, but I'm not submitting it, just
correcting yours -- feel free to add a ChangeLog entry and send).
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019