CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
301 stars 189 forks source link

it looks like that netconf_monitoring.c miss a defination #1397

Closed crystal032 closed 1 year ago

crystal032 commented 1 year ago

Hello, When I compiled netopeer2-2.1.59, there were some errors as follows: In file included from /home/melon/netopeer2-2.1.59/src/common.h:28:0, from /home/melon/netopeer2-2.1.59/src/netconf_monitoring.c:29: /home/melon/netopeer2-2.1.59/build/compat/compat.h:145:53: error: unknown type name ‘clockid_t’ int pthread_mutex_clocklock(pthread_mutex_t mutex, clockid_t clockid, const struct timespec abstime); ^ /home/melon/netopeer2-2.1.59/build/compat/compat.h:149:32: error: unknown type name ‘pthread_rwlock_t’ int pthread_rwlock_clockrdlock(pthread_rwlock_t rwlock, clockid_t clockid, const struct timespec abstime); ^ /home/melon/netopeer2-2.1.59/build/compat/compat.h:149:58: error: unknown type name ‘clockid_t’ int pthread_rwlock_clockrdlock(pthread_rwlock_t rwlock, clockid_t clockid, const struct timespec abstime); ^ /home/melon/netopeer2-2.1.59/build/compat/compat.h:153:32: error: unknown type name ‘pthread_rwlock_t’ int pthread_rwlock_clockwrlock(pthread_rwlock_t rwlock, clockid_t clockid, const struct timespec abstime); ^ /home/melon/netopeer2-2.1.59/build/compat/compat.h:153:58: error: unknown type name ‘clockid_t’ int pthread_rwlock_clockwrlock(pthread_rwlock_t rwlock, clockid_t clockid, const struct timespec abstime); ^ /home/melon/netopeer2-2.1.59/build/compat/compat.h:157:74: error: unknown type name ‘clockid_t’ int pthread_cond_clockwait(pthread_cond_t cond, pthread_mutex_t mutex, clockid_t clockid, const struct timespec *abstime); ^ In file included from /home/melon/netopeer2-2.1.59/src/netconf_monitoring.c:29:0: /home/melon/netopeer2-2.1.59/src/common.h:41:21: error: field ‘timestamp’ has incomplete type struct timespec timestamp; ^ /home/melon/netopeer2-2.1.59/src/netconf_monitoring.c: In function ‘ncm_data_add_ds_lock’: /home/melon/netopeer2-2.1.59/src/netconf_monitoring.c:249:21: error: storage size of ‘ts’ isn’t known struct timespec ts; ^ /home/melon/netopeer2-2.1.59/src/netconf_monitoring.c:249:21: warning: unused variable ‘ts’ [-Wunused-variable] CMakeFiles/serverobj.dir/build.make:110: recipe for target 'CMakeFiles/serverobj.dir/src/netconf_monitoring.c.o' failed make[2]: [CMakeFiles/serverobj.dir/src/netconf_monitoring.c.o] Error 1 CMakeFiles/Makefile2:168: recipe for target 'CMakeFiles/serverobj.dir/all' failed make[1]: [CMakeFiles/serverobj.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 But sysrepo was compiled successfully, and I found the difference was "#define _GNU_SOURCE". When I add this defination to netconf_monitoring.c, netopeer2's compilation is passed too.

michalvasko commented 1 year ago

Already fixed in a0cfbc8c99a539166be4470f9fa9611740a6c902.