After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 71184 - Missing includes
Missing includes
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: File operations
cvs (head)
Other Solaris
: High major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 92494 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-02-11 14:48 UTC by Morten Welinder
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0


Attachments
Patch to fix libgnomevfs (2.00 KB, patch)
2002-02-11 14:48 UTC, Morten Welinder
none Details | Review

Description Morten Welinder 2002-02-11 14:48:11 UTC
Solaris, when using gcc, handles 64-bit stuff using a lot of

   #define open open64

type of defines.  Thus special case is required to make sure all files
that use such an identifier have consistent includes.  Also, some files
lack <sys/stat.h> outright.
Comment 1 Morten Welinder 2002-02-11 14:48:57 UTC
Created attachment 6692 [details] [review]
Patch to fix libgnomevfs
Comment 2 Darin Adler 2002-02-11 15:28:44 UTC
Sorry, could you explain this again?

This sounds the same as Linux, and I'm having trouble understanding
why gnome-vfs-mime.h needs to include <sys/stat.h> on Solaris, but
not on Linux.

Could you perhaps show me some of the errors that occur without this
patch?
Comment 3 Morten Welinder 2002-02-11 16:08:11 UTC
Let me see...

1. The Makefile ends up doing -D_FILE_OFFSET_BITS=64
2. On solaris, this is implemented as [slighly edited]:

#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
#ifdef __PRAGMA_REDEFINE_EXTNAME
#pragma redefine_extname	open	open64
#else
#define
open
		open64
#endif
#endif
/* !_LP64 && _FILE_OFFSET_BITS == 64 */

3. gcc does not have __PRAGMA_REDEFINE_EXTNAME.  (cc does.)

4. GnomeVFSSpecificOp is a union that contains an "open" member.


Conclusion: the definition (gnome-vfs-job.h) must be included
*after* the relevant system header(s).  Otherwise I get a "union
has no open64 member" or some such.


5. "struct stat *" requires <sys/stat.h>, even on Linux.  I actually
see the problem because of a "#define stat stat64".
Comment 4 Darin Adler 2002-02-11 16:35:46 UTC
Ah, it's your point #4 that I missed. That explains it!

Lets put a comment to that effect at the top of gnome-vfs-job.h
to explain why we have to include headers even though we don't use
anything in those headers.

And I understand your point #5 too.

What's the explanation for gnome-vfs-method.h?

And I made a similar change to the stable branch, so we probably need
these fixes there too.
Comment 5 Morten Welinder 2002-02-11 16:40:53 UTC
> What's the explanation for gnome-vfs-method.h?

Some variation of the same thing.  Maybe the "open" member of
struct GnomeVFSMethod.
Comment 6 Darin Adler 2002-02-11 16:43:30 UTC
Well, you definitely have my OK to commit these changes, with
brief comments explaining why those includes are in there
so that future maintainers don't remove the "unneeded" includes.
Comment 7 Morten Welinder 2002-02-12 14:33:52 UTC
fixed in cvs.
Comment 8 Chaskiel Grundman 2002-09-04 17:00:37 UTC
*** Bug 92494 has been marked as a duplicate of this bug. ***