ifdef __cplusplus spinlock and condvar constructors.

So scale-amd64 can build lwIP again..
上级 85628dc5
...@@ -6,6 +6,7 @@ struct condvar { ...@@ -6,6 +6,7 @@ struct condvar {
struct spinlock lock; struct spinlock lock;
LIST_HEAD(waiters, proc) waiters; LIST_HEAD(waiters, proc) waiters;
#ifdef __cplusplus
// Create a condvar that will later be initialized by initcondvar. // Create a condvar that will later be initialized by initcondvar.
// XXX(austin) Remove this and initcondvar. // XXX(austin) Remove this and initcondvar.
constexpr condvar() constexpr condvar()
...@@ -14,4 +15,5 @@ struct condvar { ...@@ -14,4 +15,5 @@ struct condvar {
constexpr constexpr
condvar(const char *name) condvar(const char *name)
: lock(name, LOCKSTAT_CONDVAR), waiters{} { } : lock(name, LOCKSTAT_CONDVAR), waiters{} { }
#endif // __cplusplus
}; };
...@@ -21,6 +21,7 @@ struct spinlock { ...@@ -21,6 +21,7 @@ struct spinlock {
struct klockstat *stat; struct klockstat *stat;
#endif #endif
#ifdef __cplusplus
// Create a spinlock that will later be initialized by initlock. // Create a spinlock that will later be initialized by initlock.
// XXX(austin) Remove this and initlock in favor of the other ctor. // XXX(austin) Remove this and initlock in favor of the other ctor.
constexpr spinlock() constexpr spinlock()
...@@ -44,6 +45,7 @@ struct spinlock { ...@@ -44,6 +45,7 @@ struct spinlock {
, stat(lockstat ? nullptr : &klockstat_lazy) , stat(lockstat ? nullptr : &klockstat_lazy)
#endif #endif
{ } { }
#endif // __cplusplus
}; };
#if SPINLOCK_DEBUG #if SPINLOCK_DEBUG
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论