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_cond.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_cond.c')
| -rw-r--r-- | lib/libpthread/pthread_cond.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_cond.c b/lib/libpthread/pthread_cond.c index b472c8d5b89..08b10f13355 100644 --- a/lib/libpthread/pthread_cond.c +++ b/lib/libpthread/pthread_cond.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_cond.c,v 1.76 2020/06/14 21:33:28 ad Exp $ */ +/* $NetBSD: pthread_cond.c,v 1.77 2022/02/12 14:59:32 riastradh Exp $ */ /*- * Copyright (c) 2001, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,10 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_cond.c,v 1.76 2020/06/14 21:33:28 ad Exp $"); +__RCSID("$NetBSD: pthread_cond.c,v 1.77 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 <stdlib.h> #include <errno.h> |
