mount.h/radix.h

看板DFBSD_submit作者時間21年前 (2005/01/26 02:03), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/4 (看更多)
mount.h does: #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) #include <net/radix.h> radix.h: #ifndef _KERNEL #include <stdbool.h> #define boolean_t bool #define R_Malloc(p, t, n) (p = (t) malloc((n))) #define Free(p) free(p); #else #define R_Malloc(p, t, n) (p = (t) malloc((n), M_RTABLE, M_INTWAIT | M_NULLOK)) #define Free(p) free(p, M_RTABLE); #endif Isn't this kind of backwards? I mean, if you develop userland applications you include sys/types.h, which type defines boolean_t to an int, then you include stdbool.h and happily hardwire it to boolean_t while stdbool.h should fix the case if the compiler doesn't support the _Bool object by hardwiring it to an int typedef. So totally unneeded. Also, if _KERNEL is defined, where is the boolean_t picked up from in order to properly use rn_refines? boolean_t rn_refines (char *, char *); -- Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono Free Tibet! http://www.savetibet.org/ | http://ashemedai.deviantart.com/ http://www.tendra.org/ | http://www.in-nomine.org/ Of course I can't say, whether it will become better if it gets changed; but as much as I can say, it must change if it shall become good...
文章代碼(AID): #11zeds00 (DFBSD_submit)
文章代碼(AID): #11zeds00 (DFBSD_submit)