Apparently system library header files has been changed for latest Xcode hiding definition of `struct nfsstats`. As a result sigar fails to compile. Xcode Version 13.2.1 (13C100) MacOS Monteray 12.1 (21C52) Steps I used: ```bash git clone https://github.com/hyperic/sigar.git cd sigar mkdir build cd build cmake -G Xcode .. cmake --build . -j 4 ``` Outcome: ``` /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3233:24: error: invalid application of 'sizeof' to an incomplete type 'struct nfsstats' size_t len = sizeof(*stats); ^~~~~~~~ /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3231:32: note: forward declaration of 'struct nfsstats' static int get_nfsstats(struct nfsstats *stats) ^ /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3303:21: error: variable has incomplete type 'struct nfsstats' struct nfsstats stats; ^ /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3303:12: note: forward declaration of 'struct nfsstats' struct nfsstats stats; ^ /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3329:21: error: variable has incomplete type 'struct nfsstats' struct nfsstats stats; ^ /Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3329:12: note: forward declaration of 'struct nfsstats' struct nfsstats stats; ^ ``` I'm still trying to find proper header file to include, but no luck so far. I will provide pull request when I find solution.
Activity
MarekR22 commentedon Jan 17, 2022
Looks like meaning of constant NFS_NFSSTATS has changed.
It is used here.
Old version of NFS_NFSSTATS is defined here.
Now when I jump to this constant when using new Xcode (new SDK) this defintion has following comment
Now old definition of
struct nfsstats:New
struct nfsclntstats:So they are look similar, but not same.
Note this breaks binary compatibility :/ so this this Apple bug :(.