Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osxfuse.pc contains -D__FreeBSD__=10 #17

Closed
gdt opened this issue Dec 21, 2011 · 7 comments
Assignees
Milestone

Comments

@gdt
Copy link

@gdt gdt commented Dec 21, 2011

This causes wrong behavior in other code. In my case, the python fuse bindings try to include files present on FreeBSD but not on OS X because this is defined.

In 2.3.8:

Cflags: -I${includedir}/osxfuse/fuse -D__DARWIN_64_BIT_INO_T=1 -D__FreeBSD__=10 -D_FILE_OFFSET_BITS=64

@bfleischer

This comment has been minimized.

Copy link
Member

@bfleischer bfleischer commented Dec 22, 2011

In its current form the compiler flag __FreeBSD__ is needed to compile libfuse/libosxfuse 2.7.3 for Mac OS X. All mac-specific extensions to libfuse are guarded by checks like:

#if __FreeBSD__ >= 10
...
#endif

This is something we inherited from MacFUSE. Replacing the __FreeBSD__ with the proper __APPLE__ flag is on my list. But I can't give you an exact time frame. This will most likely happen in the move from libfuse 2.3.7 to 2.8.x in OSXFUSE 2.4.0.

I have never used the python bindings myself, but maybe there is some workaround until this is fixed. You could try the Google group. MacFUSE should have the same issue since it misuses the __FreeBSD__ flag, too.

@ghost ghost assigned bfleischer Dec 22, 2011
@gdt

This comment has been minimized.

Copy link
Author

@gdt gdt commented Dec 22, 2011

I see. I'm not trying to say that the use of __FreeBSD__ inside the OSXFUSE code is a problem. The problem is that this symbol is visible other code. Are you saying that __FreeBSD__ needs to be defined when fuse.h is included, or just for the .c files that make up the library? If just for the C files, then it probably doesn't belong in the pkg-config file. I have removed it but am running into another issue; I'll keep trying and post on the list.

@bfleischer

This comment has been minimized.

Copy link
Member

@bfleischer bfleischer commented Dec 22, 2011

It is needed for the header files! What problems are you running into?

@gdt

This comment has been minimized.

Copy link
Author

@gdt gdt commented Dec 22, 2011

The specific problem is compiling a C file which includes both fuse.h and python headers (this is the standard code to provide python access to fuse, in the fuse-python tarball from the fuse project). Due to __FreeBSD__ being defined, the python .h file (part of the installed python 2.6) tries to include osreldate.h, which exists on FreeBSD, but not on OS X.

So I can try undefining __FreeBSD__ in that .c file after including fuse.h and before including Python.h. I'll have to do that conditonally on APPLE or something, because then it would break on actual FreeBSD.

@bfleischer

This comment has been minimized.

Copy link
Member

@bfleischer bfleischer commented Dec 22, 2011

According to the googledocs-fs thread creating an empty osreldate.h works. (See http://blog.vucica.net/2010/11/some-tips-on-building-fuse-python-on-mac-os-x.html). But this might not be the workaround, you are looking for.

@bfleischer

This comment has been minimized.

Copy link
Member

@bfleischer bfleischer commented Feb 29, 2012

__FreeBSD__=10 has been replaced with __APPLE__ in commit osxfuse/fuse@bb907cc. The fix will be in OSXFUSE 2.4.0.

@bfleischer

This comment has been minimized.

Copy link
Member

@bfleischer bfleischer commented Mar 9, 2012

libosxfuse, OSXFUSE.framework and the kernel extension are using __APPLE__ instead of __FreeBSD__ from now on. See commit c37a109.

@bfleischer bfleischer closed this Mar 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.