3 #ifndef INCLUDE_NN_NLIB_PLATFORM_CTR_H_ 4 #define INCLUDE_NN_NLIB_PLATFORM_CTR_H_ 5 #ifndef INCLUDE_NN_NLIB_PLATFORM_H_ 6 # error do not include directly 11 #define NLIB_HAS_STDHEADER_STDINT 12 #define NLIB_HAS_STDHEADER_INTTYPES 14 #ifndef __USE_C99_MATH 15 # define __USE_C99_MATH 24 #define NLIB_ALWAYS_INLINE __forceinline 25 #define NLIB_NEVER_INLINE __declspec(noinline) 29 #define NLIB_LIKELY(x) __builtin_expect(!!(x), 1) 30 #define NLIB_UNLIKELY(x) __builtin_expect(!!(x), 0) 31 #define NLIB_EXPECT(var, exp_value) __builtin_expect((var), (exp_value)) 32 #define NLIB_CHECK_RESULT 33 #define NLIB_NORETURN __attribute__((noreturn)) 34 #define NLIB_NONNULL __attribute__((nonnull)) 35 #define NLIB_NONNULL_1 __attribute__((nonnull (1))) 36 #define NLIB_NONNULL_2 __attribute__((nonnull (2))) 37 #define NLIB_NONNULL_3 __attribute__((nonnull (3))) 38 #define NLIB_NONNULL_4 __attribute__((nonnull (4))) 39 #define NLIB_NONNULL_5 __attribute__((nonnull (5))) 40 #define NLIB_NONNULL_ENABLED 41 #define NLIB_ATTRIBUTE_MALLOC __attribute__((malloc)) 42 #define NLIB_ATTRIBUTE_PURE __attribute__((pure)) 43 #define NLIB_ATTRIBUTE_CONST __attribute__((const)) 44 #define NLIB_ATTRIBUTE_ALLOC_SIZE1(n) 45 #define NLIB_ATTRIBUTE_ALLOC_SIZE2(n0, n1) 46 #define NLIB_ATTRIBUTE_ALLOC_ALIGN(algn) 47 #define NLIB_ATTRIBUTE_ASSUME_ALIGNED(n) 48 #ifndef NLIB_DEPRECATED 49 #define NLIB_DEPRECATED 51 #ifndef NLIB_DEPRECATED_MSG 52 #define NLIB_DEPRECATED_MSG(msg) 54 #define NLIB_VIS_HIDDEN 55 #define NLIB_VIS_PUBLIC 56 #define NLIB_WEAKSYMBOL __attribute__((weak)) 57 #define NLIB_LITTLE_ENDIAN 59 void nlib_ctr_barrier(
void);
60 #define NLIB_MEMORY_ORDER_RELEASE nlib_ctr_barrier() 61 #define NLIB_MEMORY_ORDER_ACQUIRE nlib_ctr_barrier() 62 #define NLIB_MEMORY_ORDER_ACQ_REL nlib_ctr_barrier() 63 #define NLIB_MEMORY_ORDER_SEQ_CST nlib_ctr_barrier() 71 #define NLIB_MUTEX_INITIALIZER { 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL } 72 #define NLIB_RECURSIVE_MUTEX_INITIALIZER { 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL } 73 #define NLIB_RECURSIVE_TIMED_MUTEX_INITIALIZER { 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL } 77 struct nlib_semaphore_ {
86 #define NLIB_COND_INITIALIZER {0} 88 __declspec(noreturn) int MyNoreturn_(
void);
89 #define NLIB_ASSUME(cond) (void)((cond) || MyNoreturn_()) 91 #define NLIB_LIBC_nlib_memcmp 93 #define NLIB_ATOMIC_RELAXED (0) 94 #define NLIB_ATOMIC_ACQUIRE (1) 95 #define NLIB_ATOMIC_RELEASE (2) 96 #define NLIB_ATOMIC_ACQ_REL (3) 97 #define NLIB_ATOMIC_SEQ_CST (7) 103 int32_t desired,
int weak,
104 int success_memorder,
int failure_memorder);
120 int64_t desired,
int weak,
121 int success_memorder,
int failure_memorder);
136 void* desired,
int weak,
137 int success_memorder,
int failure_memorder);
144 #define NLIB_FD_O_RDONLY (0x0000) 145 #define NLIB_FD_O_WRONLY (0x0001) 146 #define NLIB_FD_O_RDWR (0x0002) 147 #define NLIB_FD_O_APPEND (0x0008) 148 #define NLIB_FD_O_CREAT (0x0100) 149 #define NLIB_FD_O_TRUNC (0x0200) 150 #define NLIB_FD_O_EXCL (0x0400) 156 #define NLIB_NOEXCEPT 157 #ifndef NLIB_HAS_ZLIB 158 # define NLIB_HAS_ZLIB 162 #endif // INCLUDE_NN_NLIB_PLATFORM_CTR_H_