1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00
freebsd-ports/databases/db5/files/patch-src_dbinc_atomic.h
Matthias Andree e44111f491 Modernize Makefile and chase new requisites.
* Modernize Makefile [1].

* The Tcl changes suggested in the PR [1] are applied but commented out
  because the code causes scary "warning: the value of the size argument
  in 'strncat' is too large, might lead to a buffer overflow
  [-Wstrncat-size]" in lang/tcl/tcl_*.c on FreeBSD 10.3 amd64.

* Other than what is suggested in the PR,
  refuse to add the TCL option, and leave --disable-tcl in.

* JAVA option: restrict to Java versions 1.6 and 1.7 because the port
  fails to compile with JAVA option enabled and openjdk8
  (IllegalArgument exception).

portlint cleanups:
* Set PATCH_WRKSRC, and refresh patches with "make makepatch".
* Use Space (not HTab) after WWW: tag in pkg-descr
* Drop "The" from COMMENT.

PR:		208740 [1]
Submitted by:	gahr@ [1]
2016-05-23 22:07:24 +00:00

39 lines
1.4 KiB
C

--- src/dbinc/atomic.h.orig 2013-09-09 15:35:08 UTC
+++ src/dbinc/atomic.h
@@ -70,7 +70,7 @@ typedef struct {
* 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 db_atomic_init(p, val) ((p)->value = (val))
#ifdef HAVE_ATOMIC_SUPPORT
@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __atomic_compare_exchange_db((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
int temp;
@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
* which configure could be changed to use.
*/
-static inline int __atomic_compare_exchange(
+static inline int __atomic_compare_exchange_db(
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
{
atomic_value_t was;
@@ -206,7 +206,7 @@ static inline int __atomic_compare_excha
#define atomic_dec(env, p) (--(p)->value)
#define atomic_compare_exchange(env, p, oldval, newval) \
(DB_ASSERT(env, atomic_read(p) == (oldval)), \
- atomic_init(p, (newval)), 1)
+ db_atomic_init(p, (newval)), 1)
#else
#define atomic_inc(env, p) __atomic_inc(env, p)
#define atomic_dec(env, p) __atomic_dec(env, p)