This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients larry
Date 2014-01-29.17:27:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391016424.61.0.88301611796.issue20170@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-01-29 17:27:04larrysetrecipients: + larry
2014-01-29 17:27:04larrysetmessageid: <1391016424.61.0.88301611796.issue20170@psf.upfronthosting.co.za>
2014-01-29 17:27:04larrylinkissue20170 messages
2014-01-29 17:27:04larrycreate