[mapguide-commits] r9886 - in sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26: dbinc mp mutex

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 15 05:12:31 PST 2021


Author: jng
Date: 2021-11-15 05:12:30 -0800 (Mon, 15 Nov 2021)
New Revision: 9886

Modified:
   sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/dbinc/atomic.h
   sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_fget.c
   sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_mvcc.c
   sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_region.c
   sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mutex/mut_method.c
Log:
#2843: Fix berkeley db build. The #define of atomic_init now collides with a symbol of the same name in the official std atomic header. We'll do the same fix as (https://github.com/microsoft/vcpkg/pull/12870), which is to prefix rename our offending atomic_init to bdb_atomic_init

Modified: sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/dbinc/atomic.h
===================================================================
--- sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/dbinc/atomic.h	2021-11-15 12:14:12 UTC (rev 9885)
+++ sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/dbinc/atomic.h	2021-11-15 13:12:30 UTC (rev 9886)
@@ -70,7 +70,7 @@
  * These have no memory barriers; the caller must include them when necessary.
  */
 #define	atomic_read(p)		((p)->value)
-#define	atomic_init(p, val)	((p)->value = (val))
+#define	bdb_atomic_init(p, val)	((p)->value = (val))
 
 #ifdef HAVE_ATOMIC_SUPPORT
 

Modified: sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_fget.c
===================================================================
--- sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_fget.c	2021-11-15 12:14:12 UTC (rev 9885)
+++ sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_fget.c	2021-11-15 13:12:30 UTC (rev 9886)
@@ -617,7 +617,7 @@
 
 		/* Initialize enough so we can call __memp_bhfree. */
 		alloc_bhp->flags = 0;
-		atomic_init(&alloc_bhp->ref, 1);
+		bdb_atomic_init(&alloc_bhp->ref, 1);
 #ifdef DIAGNOSTIC
 		if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
 			__db_errx(env,
@@ -911,7 +911,7 @@
 			MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
 			    PROT_READ);
 
-		atomic_init(&alloc_bhp->ref, 1);
+		bdb_atomic_init(&alloc_bhp->ref, 1);
 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
 		alloc_bhp->priority = bhp->priority;
 		alloc_bhp->pgno = bhp->pgno;

Modified: sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_mvcc.c
===================================================================
--- sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_mvcc.c	2021-11-15 12:14:12 UTC (rev 9885)
+++ sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_mvcc.c	2021-11-15 13:12:30 UTC (rev 9886)
@@ -276,7 +276,7 @@
 #else
 	memcpy(frozen_bhp, bhp, SSZA(BH, buf));
 #endif
-	atomic_init(&frozen_bhp->ref, 0);
+	bdb_atomic_init(&frozen_bhp->ref, 0);
 	if (mutex != MUTEX_INVALID)
 		frozen_bhp->mtx_buf = mutex;
 	else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
@@ -428,7 +428,7 @@
 #endif
 		alloc_bhp->mtx_buf = mutex;
 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
-		atomic_init(&alloc_bhp->ref, 1);
+		bdb_atomic_init(&alloc_bhp->ref, 1);
 		F_CLR(alloc_bhp, BH_FROZEN);
 	}
 

Modified: sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_region.c
===================================================================
--- sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_region.c	2021-11-15 12:14:12 UTC (rev 9885)
+++ sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mp/mp_region.c	2021-11-15 13:12:30 UTC (rev 9886)
@@ -224,7 +224,7 @@
 			     MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
 				return (ret);
 			SH_TAILQ_INIT(&htab[i].hash_bucket);
-			atomic_init(&htab[i].hash_page_dirty, 0);
+			bdb_atomic_init(&htab[i].hash_page_dirty, 0);
 		}
 
 		/*
@@ -269,7 +269,7 @@
 		hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
 		    mtx_base + i;
 		SH_TAILQ_INIT(&hp->hash_bucket);
-		atomic_init(&hp->hash_page_dirty, 0);
+		bdb_atomic_init(&hp->hash_page_dirty, 0);
 #ifdef HAVE_STATISTICS
 		hp->hash_io_wait = 0;
 		hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;

Modified: sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mutex/mut_method.c
===================================================================
--- sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mutex/mut_method.c	2021-11-15 12:14:12 UTC (rev 9885)
+++ sandbox/jng/msvc2019/Oem/dbxml/db-4.8.26/mutex/mut_method.c	2021-11-15 13:12:30 UTC (rev 9886)
@@ -426,7 +426,7 @@
 	MUTEX_LOCK(env, mtx);
 	ret = atomic_read(v) == oldval;
 	if (ret)
-		atomic_init(v, newval);
+		bdb_atomic_init(v, newval);
 	MUTEX_UNLOCK(env, mtx);
 
 	return (ret);



More information about the mapguide-commits mailing list