On 11 March 2010 23:14, Ondrej Certik <[email protected]> wrote: > Hi, > > I am attaching the two files that I want Cython to generate. > > It seem to do the job. So far, I just did them by hand and I will test > my code more in the coming days. If all is fine, I will try to modify > Cython to do that automatically. The static->extern is easy, this > patch does it: > > ond...@raven:~/repos/cython-devel$ hg diff > diff -r b8f0fc5153e0 Cython/Compiler/ModuleNode.py > --- a/Cython/Compiler/ModuleNode.py Thu Mar 11 14:06:32 2010 -0800 > +++ b/Cython/Compiler/ModuleNode.py Thu Mar 11 18:13:19 2010 -0800 > @@ -184,7 +184,7 @@ > h_code.putln("") > for entry in api_funcs: > type = CPtrType(entry.type) > - h_code.putln("static %s;" % > type.declaration_code(entry.cname)) > + h_code.putln("extern %s;" % > type.declaration_code(entry.cname)) > h_code.putln("") > h_code.put_h_guard(Naming.api_func_guard + "import_module") > h_code.put(import_module_utility_code.impl) > > > but the rest will be a bit more complicated. Let me know if you think > this is the right approach. I guess I could add some cython cmdline > option to control the global/local api. >
How about controling global/local api at C compile time, using preprocessor definitions? -- Lisandro Dalcin --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
