ctypeslib
ctypeslib copied to clipboard
Arithmetic macro not evaluated
Looks like it is misinterpreted as a function-like macro
$ cat test4.h
#define a 5
#define b 6
#define c (a+b)
#define d c
$ clang2py -k dm test4.h
# -*- coding: utf-8 -*-
#
# TARGET arch is: []
# WORD_SIZE is: 8
# POINTER_SIZE is: 8
# LONGDOUBLE_SIZE is: 16
#
import ctypes
a = 5 # macro
b = 6 # macro
# def c(5+6): # macro
# return
d = # macro
__all__ = \
['a', 'b', 'd']
in cursorhandler -> MACRO_DEFINITION added "print(tokens)"
['a', '5']
['b', '6']
['c', '(', '5', '+', '6', ')']
['d', '']