[win32] merge change#985 from maintbranch
[p5sagit/p5-mst-13.2.git] / sv.h
diff --git a/sv.h b/sv.h
index bf34547..6b4a125 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -84,10 +84,10 @@ struct io {
        ++count;                                \
        MUTEX_UNLOCK(&svref_mutex);             \
      } STMT_END
-#    define ATOMIC_DEC_AND_TEST(res,count)     \
-       MUTEX_LOCK(&svref_mutex);               \
-       res = (--count == 0);                   \
-       MUTEX_UNLOCK(&svref_mutex);             \
+#    define ATOMIC_DEC_AND_TEST(res,count) STMT_START {        \
+       MUTEX_LOCK(&svref_mutex);                       \
+       res = (--count == 0);                           \
+       MUTEX_UNLOCK(&svref_mutex);                     \
      } STMT_END
 #  else
 #    define ATOMIC_INC(count) atomic_inc(&count)
@@ -95,7 +95,7 @@ struct io {
 #  endif /* EMULATE_ATOMIC_REFCOUNTS */
 #else
 #  define ATOMIC_INC(count) (++count)
-#  define ATOMIC_DEC_AND_TEST(res, count) (res = --count)
+#  define ATOMIC_DEC_AND_TEST(res, count) (res = (--count == 0))
 #endif /* USE_THREADS */
 
 #ifdef __GNUC__
@@ -199,6 +199,7 @@ struct xpvnv {
     double     xnv_nv;         /* numeric value, if any */
 };
 
+/* These structure must match the beginning of struct xpvhv in hv.h. */
 struct xpvmg {
     char *     xpv_pv;         /* pointer to malloced string */
     STRLEN     xpv_cur;        /* length of xpv_pv as a C string */