From 44c0e223305e295f61fcfe1d52967c19731fbe1f Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 30 Jul 2013 22:06:42 +0300 Subject: Can check for members in structures. --- environment.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'environment.py') diff --git a/environment.py b/environment.py index 3ccd385..68481fa 100644 --- a/environment.py +++ b/environment.py @@ -201,6 +201,18 @@ int main(int argc, char **argv) { res = self.run(templ % (prefix, funcname)) return res.compiled + def has_member(self, typename, membername, prefix): + # This fails (returns true) if funcname is a ptr or a variable. + # The correct check is a lot more difficult. + # Fix this to do that eventually. + templ = '''%s +void foo() { + %s foo; + foo.%s; +}; +''' + return self.compiles(templ % (prefix, typename, membername)) + class CPPCompiler(CCompiler): def __init__(self, exelist): CCompiler.__init__(self, exelist) -- cgit v1.1