编译器已支持 typedef 右值类型位(305242aa),故解除 R1 的 typedef 右值例外:stdint.vp 19 处(INTPTR/BYTEPTR/CHARPTR/WCHARPTR/*PTR 等)、stdarg.vp 1 处(va_list)改为 T*,AST 与 T | t.CPtr 逐字段同形。
131 lines
3.8 KiB
Plaintext
131 lines
3.8 KiB
Plaintext
import t
|
|
|
|
|
|
# =============================================================================
|
|
# Uppercase aliases (Win32/TransPyC style)
|
|
# Note: INTPTR/UINTPTR are int*/unsigned int* pointer types here (historical), unlike the C intptr_t/uintptr_t integer types in the lowercase _t section below.
|
|
# =============================================================================
|
|
INT: t.CTypedef = int
|
|
INTPTR: t.CTypedef = int*
|
|
|
|
BOOL: t.CTypedef = int
|
|
UINT: t.CTypedef = uint
|
|
UINTPTR: t.CTypedef = UINT*
|
|
BYTE: t.CTypedef = uchar
|
|
BYTEPTR: t.CTypedef = BYTE*
|
|
WORD: t.CTypedef = uint16
|
|
DWORD: t.CTypedef = uint32
|
|
QWORD: t.CTypedef = uint64
|
|
TCHAR: t.CTypedef = char
|
|
CHARLIST: t.CTypedef = str*
|
|
VOID: t.CTypedef = void
|
|
|
|
SHORT: t.CTypedef = int16
|
|
SHORTPTR: t.CTypedef = int16*
|
|
USHORT: t.CTypedef = uint16
|
|
USHORTPTR: t.CTypedef = uint16*
|
|
|
|
LONGLONG: t.CTypedef = int64
|
|
ULONGLONG: t.CTypedef = uint64
|
|
LONG: t.CTypedef = int32
|
|
ULONG: t.CTypedef = uint32
|
|
|
|
WCHAR: t.CTypedef = WORD
|
|
WCHARPTR: t.CTypedef = WORD*
|
|
CHARPTR: t.CTypedef = char*
|
|
LPCSTR: t.CTypedef = const str
|
|
|
|
VOIDPTR: t.CTypedef = t.CPtr
|
|
FLOAT: t.CTypedef = float
|
|
DOUBLE: t.CTypedef = double
|
|
|
|
FLOAT8: t.CTypedef = t.CFloat8T
|
|
FLOAT16: t.CTypedef = t.CFloat16T
|
|
FLOAT32: t.CTypedef = t.CFloat32T
|
|
FLOAT64: t.CTypedef = double
|
|
FLOAT128: t.CTypedef = t.CFloat128T
|
|
|
|
|
|
# =============================================================================
|
|
# Fixed-width uppercase integer aliases
|
|
# =============================================================================
|
|
INT8: t.CTypedef = int8
|
|
INT16: t.CTypedef = int16
|
|
INT32: t.CTypedef = int32
|
|
INT64: t.CTypedef = int64
|
|
|
|
UINT8: t.CTypedef = uint8
|
|
UINT16: t.CTypedef = uint16
|
|
UINT32: t.CTypedef = uint32
|
|
UINT64: t.CTypedef = uint64
|
|
|
|
INT8PTR: t.CTypedef = int8*
|
|
INT16PTR: t.CTypedef = int16*
|
|
INT32PTR: t.CTypedef = int32*
|
|
INT64PTR: t.CTypedef = int64*
|
|
|
|
UINT8PTR: t.CTypedef = uint8*
|
|
UINT16PTR: t.CTypedef = uint16*
|
|
UINT32PTR: t.CTypedef = uint32*
|
|
UINT64PTR: t.CTypedef = uint64*
|
|
|
|
CHAR8: t.CTypedef = t.CChar8T
|
|
CHAR16: t.CTypedef = t.CChar16T
|
|
CHAR32: t.CTypedef = t.CChar32T
|
|
CHAR8PTR: t.CTypedef = t.CChar8T*
|
|
CHAR16PTR: t.CTypedef = t.CChar16T*
|
|
CHAR32PTR: t.CTypedef = t.CChar32T*
|
|
|
|
i8: t.CTypedef = int8
|
|
i16: t.CTypedef = int16
|
|
i32: t.CTypedef = int32
|
|
i64: t.CTypedef = int64
|
|
|
|
u8: t.CTypedef = uint8
|
|
u16: t.CTypedef = uint16
|
|
u32: t.CTypedef = uint32
|
|
u64: t.CTypedef = uint64
|
|
|
|
SIZE_T: t.CTypedef = sizet
|
|
SSIZE_T: t.CTypedef = t.CPtrDiffT
|
|
PTRDIFF_T: t.CTypedef = t.CPtrDiffT
|
|
|
|
|
|
# =============================================================================
|
|
# C standard library <stdint.h> type names (lowercase _t suffix)
|
|
# C standard type names provided here as typedefs; after `from stdint import *` you can use int8_t / size_t etc. directly.
|
|
# =============================================================================
|
|
int8_t: t.CTypedef = int8
|
|
int16_t: t.CTypedef = int16
|
|
int32_t: t.CTypedef = int32
|
|
int64_t: t.CTypedef = int64
|
|
|
|
uint8_t: t.CTypedef = uint8
|
|
uint16_t: t.CTypedef = uint16
|
|
uint32_t: t.CTypedef = uint32
|
|
uint64_t: t.CTypedef = uint64
|
|
|
|
size_t: t.CTypedef = sizet
|
|
ssize_t: t.CTypedef = t.CPtrDiffT
|
|
ptrdiff_t: t.CTypedef = t.CPtrDiffT
|
|
|
|
# intptr_t/uintptr_t are integer types large enough to hold a pointer (NOT pointers!)
|
|
# Different from the INTPTR/UINTPTR above (int pointers).
|
|
intptr_t: t.CTypedef = t.CIntPtrT
|
|
uintptr_t: t.CTypedef = t.CUIntPtrT
|
|
|
|
# Wide-character / character types
|
|
wchar_t: t.CTypedef = t.CWCharT
|
|
char8_t: t.CTypedef = t.CChar8T
|
|
char16_t: t.CTypedef = t.CChar16T
|
|
char32_t: t.CTypedef = t.CChar32T
|
|
|
|
# Floating-point specializations
|
|
float8_t: t.CTypedef = t.CFloat8T
|
|
float16_t: t.CTypedef = t.CFloat16T
|
|
float32_t: t.CTypedef = t.CFloat32T
|
|
float64_t: t.CTypedef = double
|
|
float128_t: t.CTypedef = t.CFloat128T
|
|
|
|
_Bool: t.CTypedef = bool
|