public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	aj@suse.de
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] sys/stat.h fix
Date: Wed, 01 Jan 2003 22:13:00 -0000	[thread overview]
Message-ID: <20030101231340.J1310@sunsite.ms.mff.cuni.cz> (raw)

Hi!

echo '#include <sys/stat.h>' | gcc -c -xc -
fails with:
In file included from /usr/include/sys/stat.h:101,
                 from <stdin>:1:
/usr/include/bits/stat.h:70: field `st_atim' has incomplete type
/usr/include/bits/stat.h:71: field `st_mtim' has incomplete type
/usr/include/bits/stat.h:72: field `st_ctim' has incomplete type

The problem is that time.h is included in sys/stat.h only if
__USE_XOPEN. The following patch reorganizes it so that
time.h is included even if defined __USE_MISC && !defined __USE_XOPEN
(in that case just with __need_timespec defined).

2003-01-01  Jakub Jelinek  <jakub@redhat.com>

	* io/sys/stat.h: Incldue time.h with __need_timespec even if
	__USE_MISC is defined but __USE_XOPEN is not.

--- libc/io/sys/stat.h.jj	2003-01-01 03:33:18.000000000 +0100
+++ libc/io/sys/stat.h	2003-01-02 00:36:11.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,13 +27,17 @@
 
 #include <bits/types.h>		/* For __mode_t and __dev_t.  */
 
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_MISC
+# ifdef __USE_XOPEN
+#  define __need_time_t
+# endif
 # ifdef __USE_MISC
 #  define __need_timespec
 # endif
-# define __need_time_t
-# include <time.h>		/* For time_t.  */
+# include <time.h>		/* For time_t resp. timespec.  */
+#endif
 
+#ifdef __USE_XOPEN
 /* The Single Unix specification says that some more types are
    available here.  */
 # ifndef __dev_t_defined

	Jakub

             reply	other threads:[~2003-01-01 22:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-01 22:13 Jakub Jelinek [this message]
2003-01-02  7:51 ` Andreas Jaeger
  -- strict thread matches above, loose matches on Subject: below --
2000-06-30 14:17 Jakub Jelinek
2000-06-30 22:01 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030101231340.J1310@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=aj@suse.de \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).