[Python-checkins] CVS: python/dist/src/Mac/Modules/cf _CFmodule.c,1.5,1.5.2.1
Jack Jansen
jackjansen@users.sourceforge.net
2001年11月29日 05:23:56 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/cf
In directory usw-pr-cvs1:/tmp/cvs-serv23392/Python/Mac/Modules/cf
Modified Files:
Tag: r22b2-branch
_CFmodule.c
Log Message:
Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform".
Index: _CFmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/_CFmodule.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** _CFmodule.c 2001年11月05日 14:39:05 1.5
--- _CFmodule.c 2001年11月29日 13:23:53 1.5.2.1
***************
*** 6,15 ****
- #ifdef _WIN32
- #include "pywintoolbox.h"
- #else
#include "macglue.h"
#include "pymactoolbox.h"
- #endif
/* Macro to test whether a weak-loaded CFM function exists */
[...1061 lines suppressed...]
***************
*** 3042,3046 ****
--- 3224,3230 ----
PyObject *_res = NULL;
CFTypeID _rv;
+ #ifndef CFURLGetTypeID
PyMac_PRECHECK(CFURLGetTypeID);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 3060,3064 ****
--- 3244,3250 ----
CFStringEncoding encoding;
CFURLRef baseURL;
+ #ifndef CFURLCreateWithBytes
PyMac_PRECHECK(CFURLCreateWithBytes);
+ #endif
if (!PyArg_ParseTuple(_args, "s#lO&",
&URLBytes__in__, &URLBytes__in_len__,