On 4.9-pre, vm/vm_map.h is not C++ compatible, due to this kind of call: lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc);
C++ (or rather, gcc 2.95.4) refuses to cast (void *) to the desired (struct simplelock *), so C++ compilations that accidentally include vm/vm_map.h fail. So do C++ compiles that intentionally pick it up, like kfontinst, which is why I'm cc-ing [EMAIL PROTECTED] The attached patch replaces all the (void *) casts with casts to the correct type; this fixes kfontinst, at the very least. It doesn't seem to hurt C compilation, either. -- pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[EMAIL PROTECTED]> Key fingerprint = 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE
--- /tmp/vm_map.h Thu Sep 25 10:13:53 2003 +++ /usr/include/vm/vm_map.h Thu Sep 25 10:19:50 2003 @@ -225,7 +225,7 @@ #define vm_map_lock(map) \ do { \ printf ("locking map LK_EXCLUSIVE: 0x%x\n", map); \ - if (lockmgr(&(map)->lock, LK_EXCLUSIVE, (void *)0, curproc) != 0) { \ + if (lockmgr(&(map)->lock, LK_EXCLUSIVE, (struct simplelock *)0, curproc) != 0) { \ panic("vm_map_lock: failed to get lock"); \ } \ (map)->timestamp++; \ @@ -233,7 +233,7 @@ #else #define vm_map_lock(map) \ do { \ - if (lockmgr(&(map)->lock, LK_EXCLUSIVE, (void *)0, curproc) != 0) { \ + if (lockmgr(&(map)->lock, LK_EXCLUSIVE, (struct simplelock *)0, curproc) != 0) { \ panic("vm_map_lock: failed to get lock"); \ } \ (map)->timestamp++; \ @@ -242,7 +242,7 @@ #else #define vm_map_lock(map) \ do { \ - lockmgr(&(map)->lock, LK_EXCLUSIVE, (void *)0, curproc); \ + lockmgr(&(map)->lock, LK_EXCLUSIVE, (struct simplelock *)0, curproc); \ (map)->timestamp++; \ } while(0) #endif /* DIAGNOSTIC */ @@ -251,25 +251,25 @@ #define vm_map_unlock(map) \ do { \ printf ("locking map LK_RELEASE: 0x%x\n", map); \ - lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc); \ + lockmgr(&(map)->lock, LK_RELEASE, (struct simplelock *)0, curproc); \ } while (0) #define vm_map_lock_read(map) \ do { \ printf ("locking map LK_SHARED: 0x%x\n", map); \ - lockmgr(&(map)->lock, LK_SHARED, (void *)0, curproc); \ + lockmgr(&(map)->lock, LK_SHARED, (struct simplelock *)0, curproc); \ } while (0) #define vm_map_unlock_read(map) \ do { \ printf ("locking map LK_RELEASE: 0x%x\n", map); \ - lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc); \ + lockmgr(&(map)->lock, LK_RELEASE, (struct simplelock *)0, curproc); \ } while (0) #else #define vm_map_unlock(map) \ - lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc) + lockmgr(&(map)->lock, LK_RELEASE, (struct simplelock *)0, curproc) #define vm_map_lock_read(map) \ - lockmgr(&(map)->lock, LK_SHARED, (void *)0, curproc) + lockmgr(&(map)->lock, LK_SHARED, (struct simplelock *)0, curproc) #define vm_map_unlock_read(map) \ - lockmgr(&(map)->lock, LK_RELEASE, (void *)0, curproc) + lockmgr(&(map)->lock, LK_RELEASE, (struct simplelock *)0, curproc) #endif static __inline__ int @@ -278,7 +278,7 @@ #if defined(MAP_LOCK_DIAGNOSTIC) printf("locking map LK_EXCLUPGRADE: 0x%x\n", map); #endif - error = lockmgr(&map->lock, LK_EXCLUPGRADE, (void *)0, p); + error = lockmgr(&map->lock, LK_EXCLUPGRADE, (struct simplelock *)0, p); if (error == 0) map->timestamp++; return error; @@ -290,11 +290,11 @@ #define vm_map_lock_downgrade(map) \ do { \ printf ("locking map LK_DOWNGRADE: 0x%x\n", map); \ - lockmgr(&(map)->lock, LK_DOWNGRADE, (void *)0, curproc); \ + lockmgr(&(map)->lock, LK_DOWNGRADE, (struct simplelock *)0, curproc); \ } while (0) #else #define vm_map_lock_downgrade(map) \ - lockmgr(&(map)->lock, LK_DOWNGRADE, (void *)0, curproc) + lockmgr(&(map)->lock, LK_DOWNGRADE, (struct simplelock *)0, curproc) #endif #define vm_map_set_recursive(map) \
_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "[EMAIL PROTECTED]"