示例#1
0
if constants.VERSION < 40200:
    DRAFT_API = False
else:
    DRAFT_API = bool(has('draft') and constants.DRAFT_API)

int_sockopts    = set()
int64_sockopts  = set()
bytes_sockopts  = set()
fd_sockopts     = set()
ctx_opts        = set()
msg_opts        = set()


if constants.VERSION < 30000:
    int64_sockopt_names.extend(switched_sockopt_names)
else:
    int_sockopt_names.extend(switched_sockopt_names)
    
_UNDEFINED = -9999

def _add_constant(name, container=None):
    """add a constant to be defined
    
    optionally add it to one of the sets for use in get/setopt checkers
    """
    c = getattr(constants, name, _UNDEFINED)
    if c == _UNDEFINED:
        return
    globals()[name] = c
    __all__.append(name)
示例#2
0
    'int_sockopts',
    'int64_sockopts',
    'bytes_sockopts',
    'ctx_opts',
    'ctx_opt_names',
]

int_sockopts = set()
int64_sockopts = set()
bytes_sockopts = set()
fd_sockopts = set()
ctx_opts = set()
msg_opts = set()

if constants.VERSION < 30000:
    int64_sockopt_names.extend(switched_sockopt_names)
else:
    int_sockopt_names.extend(switched_sockopt_names)

_UNDEFINED = -9999


def _add_constant(name, container=None):
    """add a constant to be defined
    
    optionally add it to one of the sets for use in get/setopt checkers
    """
    c = getattr(constants, name, _UNDEFINED)
    if c == _UNDEFINED:
        return
    globals()[name] = c