sys/posix: use '#max_field_align'

This commit is contained in:
Laytan Laats
2024-09-30 16:39:14 +02:00
parent 9919a0cacd
commit ab54ad3a75
3 changed files with 30 additions and 44 deletions
+8 -12
View File
@@ -79,19 +79,15 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
SETALL :: 9
when ODIN_OS == .Darwin {
// NOTE: this is #pragma pack(4)
semid_ds :: struct #align(4) {
sem_perm: ipc_perm, /* [PSX] operation permission structure */
sem_base: c.int32_t, /* 32 bit base ptr for semaphore set */
sem_nsems: c.ushort, /* [PSX] number of semaphores in set */
sem_otime: time_t, /* [PSX] last semop() */
semid_ds :: struct #max_field_align(4) {
sem_perm: ipc_perm, /* [PSX] operation permission structure */
sem_base: c.int32_t, /* 32 bit base ptr for semaphore set */
sem_nsems: c.ushort, /* [PSX] number of semaphores in set */
sem_otime: time_t, /* [PSX] last semop() */
sem_pad1: c.int32_t,
using _: struct #align(4) {
sem_ctime: time_t, /* [PSX] last time changed by semctl() */
sem_pad2: c.int32_t,
sem_pad3: [4]c.int32_t,
},
sem_ctime: time_t, /* [PSX] last time changed by semctl() */
sem_pad2: c.int32_t,
sem_pad3: [4]c.int32_t,
}
} else when ODIN_OS == .FreeBSD {
semid_ds :: struct {