roken/xdbm.h does: #ifndef NDBM ... #define dbm_firstkey(db) firstkey() etc db.h from db3 does not define NDBM but does provide a macro for the dbm_mumble funtions either: #if !defined(NDBM) && !defined(dbm_firstkey) or something keying off DB_VERSION_MAJOR not being 3 is presumably in order. -D