osxfuse / filesystems

Example file systems
379 stars 94 forks source link

Unable to build unixfs on macOS 10.13 #31

Open jdsnape opened 6 years ago

jdsnape commented 6 years ago

When trying to compile on macOS 10.13 I got the following errors:

cc -I/usr/local/include/osxfuse -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -DFUSE_USE_VERSION=27 -I. -I../common/linux -I../common
/linux/kernel/include -I../common/linux/kernel/fs -I../common/unixfs -g  unixfs_ufs.c -c -o unixfs_ufs.o
In file included from unixfs_ufs.c:7:
In file included from ./ufs.h:18:
../common/linux/kernel/fs/ufs/swab.h:28:6: warning: implicit declaration of function 'UFS_SB' is invalid in C99 [-Wimplicit-function-declaration]
        if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
            ^
../common/linux/kernel/fs/ufs/swab.h:28:19: error: member reference type 'int' is not a pointer
        if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
            ~~~~~~~~~~~  ^
../common/linux/kernel/fs/ufs/swab.h:37:19: error: member reference type 'int' is not a pointer
        if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
            ~~~~~~~~~~~  ^
../common/linux/kernel/fs/ufs/swab.h:46:19: error: member reference type 'int' is not a pointer

I worked around it by editing swab.h and adding #include "ufs.h" at the top which allowed it to build. I'm not sure if that's the right approach though...