/* * CORETYPE.H * * (c)Copyright 1993-2016, Matthew Dillon, All Rights Reserved. See the * COPYRIGHT file at the base of the distribution. * * General low-level types and support used by all rune libraries. */ #include #include #include #include #include typedef char d_bool_t; typedef char runebool_t; typedef int64_t d_off_t; typedef int64_t runeoff_t; typedef int64_t runeino_t; typedef int64_t runetime_t; typedef int64_t runeuid_t; typedef int64_t runegid_t; typedef int32_t runepid_t; typedef uint32_t runedev_t; typedef uint16_t runemode_t; #if LONG_BIT == 64 typedef int64_t runesize_t; /* NOTE: The Rune size_t is signed */ typedef uint64_t urunesize_t; #elif LONG_BIT == 32 #error "32-bit systems not currently supported" typedef int32_t runesize_t; /* NOTE: The Rune size_t is signed */ typedef uint32_t urunesize_t; #else #error "LONG_BIT not set" #endif #define RUNE_FD_MAX (512 * 1024 * 1024) typedef float float32_t; typedef double float64_t; typedef long double float128_t; typedef const char *string_t; #define atomic_add_rune(ptr, count) \ atomic_add_long((ulong *)(ptr), (count)) #define atomic_fetchadd_rune(ptr, count) \ atomic_fetchadd_long((ulong *)(ptr), (count)) #define atomic_cmpset_rune(ptr, oldv, newv) \ atomic_cmpset_long((ulong *)(ptr), (ulong)(oldv), (ulong)(newv)) #define atomic_set_rune(ptr, mask) \ atomic_set_long((ulong *)(ptr), (ulong)(mask)) #define atomic_clear_rune(ptr, mask) \ atomic_clear_long((ulong *)(ptr), (ulong)(mask)) #define atomic_swap_rune(ptr, value) \ atomic_swap_long((ulong *)(ptr), (ulong)(value))