|
| 1 | +/* HASH CRC-32:0xbfe4ec49 */ |
| 2 | +/* Copyright (c) 2019-2025 Griefer@Work * |
| 3 | + * * |
| 4 | + * This software is provided 'as-is', without any express or implied * |
| 5 | + * warranty. In no event will the authors be held liable for any damages * |
| 6 | + * arising from the use of this software. * |
| 7 | + * * |
| 8 | + * Permission is granted to anyone to use this software for any purpose, * |
| 9 | + * including commercial applications, and to alter it and redistribute it * |
| 10 | + * freely, subject to the following restrictions: * |
| 11 | + * * |
| 12 | + * 1. The origin of this software must not be misrepresented; you must not * |
| 13 | + * claim that you wrote the original software. If you use this software * |
| 14 | + * in a product, an acknowledgement (see the following) in the product * |
| 15 | + * documentation is required: * |
| 16 | + * Portions Copyright (c) 2019-2025 Griefer@Work * |
| 17 | + * 2. Altered source versions must be plainly marked as such, and must not be * |
| 18 | + * misrepresented as being the original software. * |
| 19 | + * 3. This notice may not be removed or altered from any source distribution. * |
| 20 | + */ |
| 21 | +#ifndef __local_pthread_rwlock_clockrdlock_defined |
| 22 | +#define __local_pthread_rwlock_clockrdlock_defined |
| 23 | +#include <__crt.h> |
| 24 | +#include <bits/types.h> |
| 25 | +#if defined(__CRT_HAVE_pthread_rwlock_clockrdlock64) || defined(__CRT_HAVE___pthread_rwlock_clockrdlock64) || defined(__CRT_HAVE_pthread_rwlock_clockrdlock) |
| 26 | +#include <bits/crt/pthreadtypes.h> |
| 27 | +#include <bits/os/timespec.h> |
| 28 | +__NAMESPACE_LOCAL_BEGIN |
| 29 | +#if !defined(__local___localdep_crt_pthread_rwlock_clockrdlock32_defined) && defined(__CRT_HAVE_pthread_rwlock_clockrdlock) |
| 30 | +#define __local___localdep_crt_pthread_rwlock_clockrdlock32_defined |
| 31 | +__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_rwlock_clockrdlock32,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec32 const *__restrict __abstime),pthread_rwlock_clockrdlock,(__self,__clock_id,__abstime)) |
| 32 | +#endif /* !__local___localdep_crt_pthread_rwlock_clockrdlock32_defined && __CRT_HAVE_pthread_rwlock_clockrdlock */ |
| 33 | +#ifndef __local___localdep_pthread_rwlock_clockrdlock64_defined |
| 34 | +#define __local___localdep_pthread_rwlock_clockrdlock64_defined |
| 35 | +#if defined(__CRT_HAVE_pthread_rwlock_clockrdlock) && __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__ |
| 36 | +__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockrdlock,(__self,__clock_id,__abstime)) |
| 37 | +#elif defined(__CRT_HAVE_pthread_rwlock_clockrdlock64) |
| 38 | +__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockrdlock64,(__self,__clock_id,__abstime)) |
| 39 | +#elif defined(__CRT_HAVE___pthread_rwlock_clockrdlock64) |
| 40 | +__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),__pthread_rwlock_clockrdlock64,(__self,__clock_id,__abstime)) |
| 41 | +#elif defined(__CRT_HAVE_pthread_rwlock_clockrdlock) |
| 42 | +__NAMESPACE_LOCAL_END |
| 43 | +#include <libc/local/pthread/pthread_rwlock_clockrdlock64.h> |
| 44 | +__NAMESPACE_LOCAL_BEGIN |
| 45 | +#define __localdep_pthread_rwlock_clockrdlock64 __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock64) |
| 46 | +#else /* ... */ |
| 47 | +#undef __local___localdep_pthread_rwlock_clockrdlock64_defined |
| 48 | +#endif /* !... */ |
| 49 | +#endif /* !__local___localdep_pthread_rwlock_clockrdlock64_defined */ |
| 50 | +__LOCAL_LIBC(pthread_rwlock_clockrdlock) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t |
| 51 | +__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock))(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime) { |
| 52 | +#ifdef __CRT_HAVE_pthread_rwlock_clockrdlock |
| 53 | + __errno_t __result; |
| 54 | + struct __timespec32 __abstime32; |
| 55 | + __abstime32.tv_sec = (__time32_t)__abstime->tv_sec; |
| 56 | + __abstime32.tv_nsec = __abstime->tv_nsec; |
| 57 | + __result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_rwlock_clockrdlock32)(__self, __clock_id, &__abstime32); |
| 58 | + return __result; |
| 59 | +#else /* __CRT_HAVE_pthread_rwlock_clockrdlock */ |
| 60 | + __errno_t __result; |
| 61 | + struct __timespec64 __abstime64; |
| 62 | + __abstime64.tv_sec = (__time64_t)__abstime->tv_sec; |
| 63 | + __abstime64.tv_nsec = __abstime->tv_nsec; |
| 64 | + __result = (__NAMESPACE_LOCAL_SYM __localdep_pthread_rwlock_clockrdlock64)(__self, __clock_id, &__abstime32); |
| 65 | + return __result; |
| 66 | +#endif /* !__CRT_HAVE_pthread_rwlock_clockrdlock */ |
| 67 | +} |
| 68 | +__NAMESPACE_LOCAL_END |
| 69 | +#ifndef __local___localdep_pthread_rwlock_clockrdlock_defined |
| 70 | +#define __local___localdep_pthread_rwlock_clockrdlock_defined |
| 71 | +#define __localdep_pthread_rwlock_clockrdlock __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock) |
| 72 | +#endif /* !__local___localdep_pthread_rwlock_clockrdlock_defined */ |
| 73 | +#else /* __CRT_HAVE_pthread_rwlock_clockrdlock64 || __CRT_HAVE___pthread_rwlock_clockrdlock64 || __CRT_HAVE_pthread_rwlock_clockrdlock */ |
| 74 | +#undef __local_pthread_rwlock_clockrdlock_defined |
| 75 | +#endif /* !__CRT_HAVE_pthread_rwlock_clockrdlock64 && !__CRT_HAVE___pthread_rwlock_clockrdlock64 && !__CRT_HAVE_pthread_rwlock_clockrdlock */ |
| 76 | +#endif /* !__local_pthread_rwlock_clockrdlock_defined */ |
0 commit comments