Module Name: src Committed By: thorpej Date: Sat May 18 01:21:42 UTC 2024
Modified Files: src/sys/sys: ucontext.h Log Message: If <sys/mcontext.h> does not define __UCONTEXT_SIZE, define it as sizeof(ucontext_t). To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/ucontext.h diff -u src/sys/sys/ucontext.h:1.21 src/sys/sys/ucontext.h:1.22 --- src/sys/sys/ucontext.h:1.21 Sat May 18 01:16:21 2024 +++ src/sys/sys/ucontext.h Sat May 18 01:21:42 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ucontext.h,v 1.21 2024/05/18 01:16:21 thorpej Exp $ */ +/* $NetBSD: ucontext.h,v 1.22 2024/05/18 01:21:42 thorpej Exp $ */ /*- * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc. @@ -82,6 +82,12 @@ struct __ucontext { #define _UC_UCONTEXT_ALIGN (~0) #endif +#ifdef __UCONTEXT_SIZE +__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE); +#else +#define __UCONTEXT_SIZE sizeof(ucontext_t) +#endif + #ifndef _UC_TLSBASE #error _UC_TLSBASE not defined. #endif @@ -102,10 +108,6 @@ int setucontext(struct lwp *, const ucon void cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *); int cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int); int cpu_mcontext_validate(struct lwp *, const mcontext_t *); - -#ifdef __UCONTEXT_SIZE -__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE); -#endif #endif /* _KERNEL */ #endif /* !_SYS_UCONTEXT_H_ */