[Python-Dev] Python for Windows CE
Luke Dunstan
coder_infidel at hotmail.com
Wed May 3 17:11:17 CEST 2006
Hi,
I would like to explore the possibility of submitting patches to allow
Python to work on Windows CE out of the box. I have a few questions in
preparation:
1. Is there any reason in principle why patches for Windows CE support would
be rejected?
2. Should I submit unified diffs or context diffs?
One page says:
"Context diffs are preferred, so generate the patch using diff -c."
http://www.python.org/dev/tools/
Another says:
"We like unified diffs. We grudgingly accept contextual diffs..."
http://www.python.org/dev/patches/
3. The page http://www.python.org/dev/patches/style/ says that
platform-specific code should use preprocessor symbols documented for the
compiler, but existing Python code uses e.g. the invented MS_WIN32 symbol
instead of the standard _WIN32. Should we create a symbol MS_WINCE for
consistency or use the more common _WIN32_WCE?
4. The latest existing patch set uses os.name = "ce", and this can be used
to distinguish Windows CE from other operating systems in Python code. The
existing patches also set sys.platform = "Pocket PC", but I am not so keen
on keeping this, mainly because Windows CE is equivalent to Win32 in many
cases. Any comments?
5. Windows CE lacks some header files that are present on other platforms,
e.g. <direct.h>. If we ignore the actual declarations in the header for a
moment, there are a few ways to solve this problem:
(a) The obvious solution is to wrap each #include <direct.h> inside #ifndef
MS_WINCE...#endif
(b) Instead we could use #ifdef HAVE_DIRECT_H, requiring patches to #define
HAVE_DIRECT_H for other platforms
(c) The existing patch set uses a simpler solution by creating a (possibly
empty) direct.h in a Windows CE-specific subdirectory of the Python source
tree, and adding that directory to the compiler include path. This means
that the source files probably won't need to be patched and it may help when
building C extension modules.
Is there any objection to the method (c) of providing missing headers? What
is the preferred solution?
In later emails I will of course go into more detail about the patches
required. Any general tips on how to submit good patches are welcome.
Thanks,
Luke Dunstan
More information about the Python-Dev
mailing list