Larry Hastings added the comment:

Actually, forget about the file output preset.  It wouldn't work for 
posixmodule.  > 80% of the entry points are #ifdef conditional on platform 
functionality.  Which means the Clinic generated stuff needs to be #ifdef too.

It wouldn't be that hard to add the ability to #ifdef your generated code... 
but then what?  Should it generate an #endif too, right before the end of the 
block?

If it closed the #ifdef, then it'd look dumb:

    /*[clinic input]*
    ifdef HAVE_WHATNOT
    os.whatnot
    [clinic start generated code]*/
    #ifdef HAVE_WHATNOT
    ...
    static PyObject *
    os_whatnot(PyModuleType *)
    #endif /* HAVE_WHATNOT */
    /*[clinic end generated code: output=... ]*/
    #ifdef HAVE_WHATNOT
    {
        ...
    }
    #endif /* HAVE_WHATNOT */


If it didn't close the #ifdef, well, that looks dumb too:

    /*[clinic input]*
    ifdef HAVE_WHATNOT
    os.whatnot
    [clinic start generated code]*/
    #ifdef HAVE_WHATNOT
    ...
    static PyObject *
    os_whatnot(PyModuleType *)
    /*[clinic end generated code: output=... ]*/
    {
        ...
    }
    #endif /* HAVE_WHATNOT */

though maybe that's less dumb.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20170>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to