diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-02-12 14:59:32 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-02-12 14:59:32 +0000 |
| commit | f2e0628f7851077c9682dc1f7e68b04739882a6f (patch) | |
| tree | 3c06acd2d8998d5c421a28eac9f049b86f457082 /lib/libpthread/pthread_lock.c | |
| parent | 0748618c750aaf37cdcbbcc466e31e199ae3ab1f (diff) | |
libpthread: Move namespacing include to top of .c files.
Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file. If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.
I tripped over this by including <sys/atomic.h> in mips
<machine/lock.h>.
(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)
Diffstat (limited to 'lib/libpthread/pthread_lock.c')
| -rw-r--r-- | lib/libpthread/pthread_lock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_lock.c b/lib/libpthread/pthread_lock.c index 8365abd32f7..776f41d1f65 100644 --- a/lib/libpthread/pthread_lock.c +++ b/lib/libpthread/pthread_lock.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_lock.c,v 1.34 2008/04/28 20:23:01 martin Exp $ */ +/* $NetBSD: pthread_lock.c,v 1.35 2022/02/12 14:59:32 riastradh Exp $ */ /*- * Copyright (c) 2001, 2006, 2007 The NetBSD Foundation, Inc. @@ -34,7 +34,10 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_lock.c,v 1.34 2008/04/28 20:23:01 martin Exp $"); +__RCSID("$NetBSD: pthread_lock.c,v 1.35 2022/02/12 14:59:32 riastradh Exp $"); + +/* Need to use libc-private names for atomic operations. */ +#include "../../common/lib/libc/atomic/atomic_op_namespace.h" #include <sys/types.h> #include <sys/ras.h> |
