c common functions library extracted from my open source project FastDFS. this library is very simple and stable. functions including: string, logger, chain, hash, socket, ini file reader, base64 encode / decode, url encode / decode, fast timer, skiplist, object pool etc. detail info please see the c header files.
Hi!
I'm trying to compile this on FreeBSD as I'm going to upgrade from FastDFS 4.06 to FastDFS 5.08, but I'm running into these compile errors:
cc -Wall -D_FILE_OFFSET_BITS=64 -g -O3 -c -o system_info.o system_info.c system_info.c:61:13: error: use of undeclared identifier 'HW_MEMSIZE' mib[1] = HW_MEMSIZE; ^ system_info.c:595:20: error: invalid application of 'sizeof' to an incomplete type 'struct kinfo_proc' nproc = size / sizeof(struct kinfo_proc); ^
~~~~~~~ system_info.c:569:12: note: forward declaration of 'struct kinfo_proc' struct kinfo_proc procs; ^ system_info.c:610:16: error: invalid application of 'sizeof' to an incomplete type 'struct kinfo_proc' size = sizeof(struct kinfo_proc) * nproc; ^~~~~~~~ system_info.c:569:12: note: forward declaration of 'struct kinfo_proc' struct kinfo_proc procs; ^ system_info.c:644:20: error: invalid application of 'sizeof' to an incomplete type 'struct kinfo_proc' nproc = size / sizeof(struct kinfo_proc); ^~~~~~~~ system_info.c:569:12: note: forward declaration of 'struct kinfo_proc' struct kinfo_proc *procs; ^ system_info.c:661:28: error: subscript of pointer to incomplete type 'struct kinfo_proc' "%s", procs[i].kp_proc.p_comm);