Help with the build system and my first patch
Hello, I would like some help understanding the build system. I am currently working on an issue (http://bugs.python.org/issue21627) and plan to create some common functionality in Python/setcloexec.c and Include/setcloexec.h that is conditionally compiled in on POSIX systems and not on Windows systems. I need to extract this functionality out from _Py_set_inheritable because it needs to run in the dangerous context of right after a fork and I don't believe it can throw exceptions. How can I conditionally compile some library code for certain platforms only? Thank you, Steven Stewart-Gallus
On Mon Jun 09 2014 at 2:07:22 AM, Steven Stewart-Gallus < sstewartgallus00@mylangara.bc.ca> wrote:
Hello,
I would like some help understanding the build system. I am currently working on an issue (http://bugs.python.org/issue21627) and plan to create some common functionality in Python/setcloexec.c and Include/setcloexec.h that is conditionally compiled in on POSIX systems and not on Windows systems. I need to extract this functionality out from _Py_set_inheritable because it needs to run in the dangerous context of right after a fork and I don't believe it can throw exceptions. How can I conditionally compile some library code for certain platforms only?
Do you mean other than potentially detecting something in the configure script and using an #ifdef guard?
On Mon Jun 09 2014 at 1:48:27 PM, Steven Stewart-Gallus < sstewartgallus00@mylangara.bc.ca> wrote:
Do you mean other than potentially detecting something in the configurescript and using an #ifdef guard?
Yes, that works on a static function inside a file level but I need to conditionally include a whole file into the build.
Why specifically does the file itself be conditional? Typically you unconditionally include the whole file and then put the entire contents of it in a #ifdef guard.
participants (2)
-
Brett Cannon
-
Steven Stewart-Gallus