From fca7c45a62542e0f625122222386cbee9b76243f Mon Sep 17 00:00:00 2001 From: athenian200 Date: Wed, 2 Oct 2019 18:26:54 -0500 Subject: MoonchildProductions#1251 - Part 16: Resolve namespace conflicts with dbm on Solaris. https://bugzilla.mozilla.org/show_bug.cgi?id=1513913 Mozilla's solution to this is arguably overkill, since the namespace issue on Solaris only required them to change (or temporarily undefine) __log2. Instead they changed ALL the functions to be something along the lines of dbm_log2. They haven't changed the external interface at all, though. If you're unhappy with this patch, I think I could also use XP_SOLARIS ifdefs to undefine __log2 prior to where it's declared in the dbm headers. The good thing about Mozilla's solution is that it guarantees this namespace issue never occurs again on any platform, though. --- security/nss/lib/dbm/include/extern.h | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'security/nss/lib/dbm/include/extern.h') diff --git a/security/nss/lib/dbm/include/extern.h b/security/nss/lib/dbm/include/extern.h index 897369fb8..4fbdc2d80 100644 --- a/security/nss/lib/dbm/include/extern.h +++ b/security/nss/lib/dbm/include/extern.h @@ -31,32 +31,32 @@ * @(#)extern.h 8.4 (Berkeley) 6/16/94 */ -BUFHEAD *__add_ovflpage(HTAB *, BUFHEAD *); -int __addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); -int __big_delete(HTAB *, BUFHEAD *); -int __big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *); -int __big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int); -int __big_return(HTAB *, BUFHEAD *, int, DBT *, int); -int __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, - uint32, uint32, SPLIT_RETURN *); -int __buf_free(HTAB *, int, int); -void __buf_init(HTAB *, int); -uint32 __call_hash(HTAB *, char *, size_t); -int __delpair(HTAB *, BUFHEAD *, int); -int __expand_table(HTAB *); -int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int); -uint16 __find_last_page(HTAB *, BUFHEAD **); -void __free_ovflpage(HTAB *, BUFHEAD *); -BUFHEAD *__get_buf(HTAB *, uint32, BUFHEAD *, int); -int __get_page(HTAB *, char *, uint32, int, int, int); -int __ibitmap(HTAB *, int, int, int); -uint32 __log2(uint32); -int __put_page(HTAB *, char *, uint32, int, int); -void __reclaim_buf(HTAB *, BUFHEAD *); -int __split_page(HTAB *, uint32, uint32); +BUFHEAD *dbm_add_ovflpage(HTAB *, BUFHEAD *); +int dbm_addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int dbm_big_delete(HTAB *, BUFHEAD *); +int dbm_big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int dbm_big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int); +int dbm_big_return(HTAB *, BUFHEAD *, int, DBT *, int); +int dbm_big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, + uint32, uint32, SPLIT_RETURN *); +int dbm_buf_free(HTAB *, int, int); +void dbm_buf_init(HTAB *, int); +uint32 dbm_call_hash(HTAB *, char *, size_t); +int dbm_delpair(HTAB *, BUFHEAD *, int); +int dbm_expand_table(HTAB *); +int dbm_find_bigpair(HTAB *, BUFHEAD *, int, char *, int); +uint16 dbm_find_last_page(HTAB *, BUFHEAD **); +void dbm_free_ovflpage(HTAB *, BUFHEAD *); +BUFHEAD *dbm_get_buf(HTAB *, uint32, BUFHEAD *, int); +int dbm_get_page(HTAB *, char *, uint32, int, int, int); +int dbm_ibitmap(HTAB *, int, int, int); +uint32 dbm_log2(uint32); +int dbm_put_page(HTAB *, char *, uint32, int, int); +void dbm_reclaim_buf(HTAB *, BUFHEAD *); +int dbm_split_page(HTAB *, uint32, uint32); /* Default hash routine. */ -extern uint32 (*__default_hash)(const void *, size_t); +extern uint32 (*dbm_default_hash)(const void *, size_t); #ifdef HASH_STATISTICS extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows; -- cgit v1.2.3