class CConfig: _compilation_info_ = ExternalCompilationInfo(includes=includes) CLOCK_T = platform.SimpleType('clock_t', rffi.INT) TIMEVAL = platform.Struct('struct timeval', [('tv_sec', rffi.INT), ('tv_usec', rffi.INT)]) HAVE_GETTIMEOFDAY = platform.Has('gettimeofday') HAVE_FTIME = platform.Has(FTIME)
class CConfig: _compilation_info_ = ExternalCompilationInfo(includes=includes) TIMEVAL = platform.Struct('struct timeval', [('tv_sec', rffi.INT), ('tv_usec', rffi.INT)]) HAVE_GETTIMEOFDAY = platform.Has('gettimeofday') HAVE_FTIME = platform.Has(FTIME) if need_rusage: RUSAGE = platform.Struct('struct rusage', [('ru_utime', TIMEVAL), ('ru_stime', TIMEVAL)])
class CConfig: _compilation_info_ = eci calling_conv = 'c' CHECK_LIBRARY = platform.Has('dump("x", (int)&BZ2_bzCompress)') off_t = platform.SimpleType("off_t", rffi.LONGLONG) size_t = platform.SimpleType("size_t", rffi.ULONG) BUFSIZ = platform.ConstantInteger("BUFSIZ") _alloc_type = lltype.FuncType([rffi.VOIDP, rffi.INT, rffi.INT], rffi.VOIDP) _free_type = lltype.FuncType([rffi.VOIDP, rffi.VOIDP], lltype.Void) SEEK_SET = platform.ConstantInteger("SEEK_SET") bz_stream = platform.Struct('bz_stream', [('next_in', rffi.CCHARP), ('avail_in', rffi.UINT), ('total_in_lo32', rffi.UINT), ('total_in_hi32', rffi.UINT), ('next_out', rffi.CCHARP), ('avail_out', rffi.UINT), ('total_out_lo32', rffi.UINT), ('total_out_hi32', rffi.UINT), ('state', rffi.VOIDP), ('bzalloc', lltype.Ptr(_alloc_type)), ('bzfree', lltype.Ptr(_free_type)), ('opaque', rffi.VOIDP), ])
class CConfig: _compilation_info_ = ExternalCompilationInfo( includes = _includes ) CLOCKS_PER_SEC = platform.ConstantInteger("CLOCKS_PER_SEC") clock_t = platform.SimpleType("clock_t", rffi.ULONG) has_gettimeofday = platform.Has('gettimeofday')
class CConfig: _compilation_info_ = ExternalCompilationInfo( includes = ['fcntl.h', 'sys/file.h', 'sys/ioctl.h'] ) flock = platform.Struct("struct flock", [('l_start', rffi.LONGLONG), ('l_len', rffi.LONGLONG), ('l_pid', rffi.LONG), ('l_type', rffi.SHORT), ('l_whence', rffi.SHORT)]) has_flock = platform.Has('flock')
class CConfig: _compilation_info_ = eci TIMEVAL = platform.Struct('struct timeval', [('tv_sec', rffi.LONG), ('tv_usec', rffi.LONG)]) TIMESPEC = platform.Struct('struct timespec', [('tv_sec', rffi.TIME_T), ('tv_nsec', rffi.LONG)]) SEM_FAILED = platform.ConstantInteger('SEM_FAILED') SEM_VALUE_MAX = platform.ConstantInteger('SEM_VALUE_MAX') SEM_TIMED_WAIT = platform.Has('sem_timedwait') SEM_T_SIZE = platform.SizeOf('sem_t')
class CConfig: includes = ['locale.h', 'limits.h'] if HAVE_LANGINFO: includes += ['langinfo.h'] if HAVE_LIBINTL: includes += ['libintl.h'] if sys.platform == 'win32': includes += ['windows.h'] _compilation_info_ = ExternalCompilationInfo(includes=includes, ) HAVE_BIND_TEXTDOMAIN_CODESET = platform.Has('bind_textdomain_codeset') lconv = platform.Struct( "struct lconv", [ # Numeric (non-monetary) information. ("decimal_point", rffi.CCHARP), # Decimal point character. ("thousands_sep", rffi.CCHARP), # Thousands separator. ## Each element is the number of digits in each group; ## elements with higher indices are farther left. ## An element with value CHAR_MAX means that no further grouping is done. ## An element with value 0 means that the previous element is used ## for all groups farther left. */ ("grouping", rffi.CCHARP), ## Monetary information. ## First three chars are a currency symbol from ISO 4217. ## Fourth char is the separator. Fifth char is '\0'. ("int_curr_symbol", rffi.CCHARP), ("currency_symbol", rffi.CCHARP), # Local currency symbol. ("mon_decimal_point", rffi.CCHARP), # Decimal point character. ("mon_thousands_sep", rffi.CCHARP), # Thousands separator. ("mon_grouping", rffi.CCHARP), # Like `grouping' element (above). ("positive_sign", rffi.CCHARP), # Sign for positive values. ("negative_sign", rffi.CCHARP), # Sign for negative values. ("int_frac_digits", rffi.UCHAR), # Int'l fractional digits. ("frac_digits", rffi.UCHAR), # Local fractional digits. ## 1 if currency_symbol precedes a positive value, 0 if succeeds. ("p_cs_precedes", rffi.UCHAR), ## 1 iff a space separates currency_symbol from a positive value. ("p_sep_by_space", rffi.UCHAR), ## 1 if currency_symbol precedes a negative value, 0 if succeeds. ("n_cs_precedes", rffi.UCHAR), ## 1 iff a space separates currency_symbol from a negative value. ("n_sep_by_space", rffi.UCHAR), ## Positive and negative sign positions: ## 0 Parentheses surround the quantity and currency_symbol. ## 1 The sign string precedes the quantity and currency_symbol. ## 2 The sign string follows the quantity and currency_symbol. ## 3 The sign string immediately precedes the currency_symbol. ## 4 The sign string immediately follows the currency_symbol. ("p_sign_posn", rffi.UCHAR), ("n_sign_posn", rffi.UCHAR), ])
class CConfig: _compilation_info_ = ExternalCompilationInfo( includes=["time.h"], libraries=libraries, ) HAS_CLOCK_GETTIME = rffi_platform.Has('clock_gettime') CLOCK_REALTIME = rffi_platform.DefinedConstantInteger("CLOCK_REALTIME") CLOCK_MONOTONIC = rffi_platform.DefinedConstantInteger("CLOCK_MONOTONIC") CLOCK_MONOTONIC_RAW = rffi_platform.DefinedConstantInteger("CLOCK_MONOTONIC_RAW") CLOCK_PROCESS_CPUTIME_ID = rffi_platform.DefinedConstantInteger("CLOCK_PROCESS_CPUTIME_ID") CLOCK_THREAD_CPUTIME_ID = rffi_platform.DefinedConstantInteger("CLOCK_THREAD_CPUTIME_ID")
class CConfig: _compilation_info_ = compilation_info HAS_LOCAL_MALLOC = rffi_platform.Has("GC_local_malloc")
# depending on the OS constant_names = [ 'MAP_SHARED', 'MAP_PRIVATE', 'PROT_READ', 'PROT_WRITE', 'MS_SYNC' ] opt_constant_names = [ 'MAP_ANON', 'MAP_ANONYMOUS', 'PROT_EXEC', 'MAP_DENYWRITE', 'MAP_EXECUTABLE' ] for name in constant_names: setattr(CConfig, name, rffi_platform.ConstantInteger(name)) for name in opt_constant_names: setattr(CConfig, name, rffi_platform.DefinedConstantInteger(name)) CConfig.MREMAP_MAYMOVE = ( rffi_platform.DefinedConstantInteger("MREMAP_MAYMOVE")) CConfig.has_mremap = rffi_platform.Has('mremap(NULL, 0, 0, 0)') # a dirty hack, this is probably a macro elif _MS_WINDOWS: constant_names = [ 'PAGE_READONLY', 'PAGE_READWRITE', 'PAGE_WRITECOPY', 'FILE_MAP_READ', 'FILE_MAP_WRITE', 'FILE_MAP_COPY', 'DUPLICATE_SAME_ACCESS', 'MEM_COMMIT', 'MEM_RESERVE', 'MEM_RELEASE', 'PAGE_EXECUTE_READWRITE' ] for name in constant_names: setattr(CConfig, name, rffi_platform.ConstantInteger(name)) from pypy.rlib.rwin32 import HANDLE, LPHANDLE from pypy.rlib.rwin32 import DWORD, WORD, DWORD_PTR, LPDWORD from pypy.rlib.rwin32 import BOOL, LPVOID, LPCVOID, LPCSTR, SIZE_T from pypy.rlib.rwin32 import INT, LONG, PLONG
class CConfig: _compilation_info_ = ExternalCompilationInfo( includes=['sys/time.h'] ) HAVE_UTIMES = platform.Has('utimes')