diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-07-30 22:06:42 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-07-30 22:06:42 +0300 |
commit | 44c0e223305e295f61fcfe1d52967c19731fbe1f (patch) | |
tree | ca3bf14c770f6844ce69b651bdd61fe42b1d67b1 /environment.py | |
parent | 6ba724c5c792b1683aeee5f42ea9d836d2d75d84 (diff) | |
download | meson-44c0e223305e295f61fcfe1d52967c19731fbe1f.zip meson-44c0e223305e295f61fcfe1d52967c19731fbe1f.tar.gz meson-44c0e223305e295f61fcfe1d52967c19731fbe1f.tar.bz2 |
Can check for members in structures.
Diffstat (limited to 'environment.py')
-rw-r--r-- | environment.py | 12 |
1 files changed, 12 insertions, 0 deletions
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) |