Browse Source

Move bit set creation to compiler guard. Fix indentation on posix/sys_sem.

Isaac Andrade 11 months ago
parent
commit
cc60725eda
2 changed files with 8 additions and 5 deletions
  1. 4 1
      core/sys/posix/fcntl.odin
  2. 4 4
      core/sys/posix/sys_sem.odin

+ 4 - 1
core/sys/posix/fcntl.odin

@@ -143,6 +143,8 @@ when ODIN_OS == .Linux {
 		// RDONLY = 0, // Default
 	}
 
+	O_Flags :: bit_set[O_Flag_Bits; c.int]
+
 } else {
 
 	O_Flag_Bits :: enum c.int {
@@ -190,8 +192,9 @@ when ODIN_OS == .Linux {
 		// Reading only.
 		// RDONLY = 0, // Default
 	}
+
+	O_Flags :: bit_set[O_Flag_Bits; c.int]
 }
-O_Flags :: bit_set[O_Flag_Bits; c.int]
 
 // A mask of all the access mode bits.
 when ODIN_OS == .Linux {

+ 4 - 4
core/sys/posix/sys_sem.odin

@@ -143,12 +143,12 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
 	semid_ds :: struct {
 		sem_perm:  ipc_perm,  // [PSX] operation permission structure
 		sem_otime: time_t,    // [PSX] last semop()
-    __sem_otime_high: c.ulong,
+		__sem_otime_high: c.ulong,
 		sem_ctime: time_t,    // [PSX] last time changed by semctl()
-    __sem_ctime_high: c.ulong,
+		__sem_ctime_high: c.ulong,
 		sem_nsems: c.ulong, // [PSX] number of semaphores in set
-    __glibc_reserved3: c.ulong,
-    __glibc_reserved4: c.ulong,
+		__glibc_reserved3: c.ulong,
+		__glibc_reserved4: c.ulong,
 	}
 
 	sembuf :: struct {