Skip to content

Commit 56220e5

Browse files
richardlaucjihrig
authored andcommitted
aix: guard STATIC_ASSERT for glibc work around
On 64-bit AIX `sizeof(uv_sem_t)` is 4 bytes which is not large enough to store a pointer. AIX doesn't use glibc so the work around introduced by #1795 doesn't apply, so guard the STATIC_ASSERT so that it is only used when the custom semaphore implementation is used. Refs: nodejs/node#20129 Refs: #1795 PR-URL: #1808 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 4f77a23 commit 56220e5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/unix/thread.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static void glibc_version_check(void) {
449449

450450
#define platform_needs_custom_semaphore 1
451451

452-
#else /* !defined(__GLIBC__) */
452+
#else /* !defined(__GLIBC__) && !defined(__MVS__) */
453453

454454
#define platform_needs_custom_semaphore 0
455455

@@ -461,8 +461,9 @@ typedef struct uv_semaphore_s {
461461
unsigned int value;
462462
} uv_semaphore_t;
463463

464-
464+
#if defined(__GLIBC__) || platform_needs_custom_semaphore
465465
STATIC_ASSERT(sizeof(uv_sem_t) >= sizeof(uv_semaphore_t*));
466+
#endif
466467

467468
static int uv__custom_sem_init(uv_sem_t* sem_, unsigned int value) {
468469
int err;

0 commit comments

Comments
 (0)