zig icon indicating copy to clipboard operation
zig copied to clipboard

fix android definition of pthread_rwlock_t

Open billzez opened this issue 3 years ago • 1 comments

These definitions no longer match the bionic source code. Also, this line was a compilation error:

__reserved: [12]u8 = [_]u8{0} ** 2

billzez avatar Sep 13 '22 09:09 billzez

If this is upstream, it indicates that it needs adjustment but that the fields remain relatively the same https://android.googlesource.com/platform/bionic/+/40eabe2/libc/include/pthread.h#230

kprotty avatar Sep 13 '22 16:09 kprotty

pthread_rwlock_t is now an opaque type in the latest bionic/ndk:

https://android.googlesource.com/platform/bionic/+/master/libc/include/pthread.h https://android.googlesource.com/platform/bionic/+/master/libc/include/bits/pthread_types.h

typedef struct {
#if defined(__LP64__)
  int32_t __private[14];
#else
  int32_t __private[10];
#endif
} pthread_rwlock_t;

The internal definition can be found here:

https://android.googlesource.com/platform/bionic/+/master/libc/bionic/pthread_rwlock.cpp

billzez avatar Sep 16 '22 00:09 billzez