Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread unnamed unions need special treatment since t...



details:   https://anonhg.NetBSD.org/src/rev/0b57225be8e9
branches:  trunk
changeset: 346592:0b57225be8e9
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 20 21:02:04 2016 +0000

description:
unnamed unions need special treatment since they need braced initializers
for old style initializations.

diffstat:

 lib/libpthread/pthread_types.h |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 1d9d69f5896d -r 0b57225be8e9 lib/libpthread/pthread_types.h
--- a/lib/libpthread/pthread_types.h    Wed Jul 20 20:18:21 2016 +0000
+++ b/lib/libpthread/pthread_types.h    Wed Jul 20 21:02:04 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_types.h,v 1.21 2016/07/20 20:06:04 christos Exp $      */
+/*     $NetBSD: pthread_types.h,v 1.22 2016/07/20 21:02:04 christos Exp $      */
 
 /*-
  * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -140,15 +140,17 @@
 
 #ifdef __cplusplus
 #define _PTHREAD_MUTEX_INI(a, b) b
+#define _PTHREAD_MUTEX_UNI(a) { 0 }
 #else
 #define _PTHREAD_MUTEX_INI(a, b) .a = b
+#define _PTHREAD_MUTEX_UNI(a) .a = 0
 #endif
 
 #define _PTHREAD_MUTEX_INITIALIZER {                                   \
        _PTHREAD_MUTEX_INI(ptm_magic, _PT_MUTEX_MAGIC),                 \
        _PTHREAD_MUTEX_INI(ptm_errorcheck, __SIMPLELOCK_UNLOCKED),      \
        _PTHREAD_MUTEX_PAD(ptm_pad1)                                    \
-       _PTHREAD_MUTEX_INI(ptm_ceiling, 0),                             \
+       _PTHREAD_MUTEX_UNI(ptm_ceiling),                                \
        _PTHREAD_MUTEX_PAD(ptm_pad2)                                    \
        _PTHREAD_MUTEX_INI(ptm_owner, NULL),                            \
        _PTHREAD_MUTEX_INI(ptm_waiters, NULL),                          \



Home | Main Index | Thread Index | Old Index