diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-24 23:04:18 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-24 23:04:18 (GMT) |
commit | 9d79990ac725830134b7a9147f18297a0e6da5db (patch) | |
tree | c304e5591addd9703fee03f75ed97a0e9a352a06 /Mac/Modules/fm | |
parent | d69711cb1ef1e44d4fcd72d6a1b01ac6f3a52782 (diff) | |
download | cpython-9d79990ac725830134b7a9147f18297a0e6da5db.zip cpython-9d79990ac725830134b7a9147f18297a0e6da5db.tar.gz cpython-9d79990ac725830134b7a9147f18297a0e6da5db.tar.bz2 |
Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.
Should finally fix 531398. 2.2.1 candidate.
Also blacklisted some constants with definitions that were not Python-compatible.
Diffstat (limited to 'Mac/Modules/fm')
-rw-r--r-- | Mac/Modules/fm/_Fmmodule.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Mac/Modules/fm/_Fmmodule.c b/Mac/Modules/fm/_Fmmodule.c index 009f34d..e6497f2 100644 --- a/Mac/Modules/fm/_Fmmodule.c +++ b/Mac/Modules/fm/_Fmmodule.c @@ -64,6 +64,9 @@ static PyObject *Fm_Error; static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; +#ifndef InitFonts + PyMac_PRECHECK(InitFonts); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; InitFonts(); @@ -78,6 +81,9 @@ static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args) PyObject *_res = NULL; short familyID; Str255 name; +#ifndef GetFontName + PyMac_PRECHECK(GetFontName); +#endif if (!PyArg_ParseTuple(_args, "h", &familyID)) return NULL; @@ -93,6 +99,9 @@ static PyObject *Fm_GetFNum(PyObject *_self, PyObject *_args) PyObject *_res = NULL; Str255 name; short familyID; +#ifndef GetFNum + PyMac_PRECHECK(GetFNum); +#endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetStr255, name)) return NULL; @@ -109,6 +118,9 @@ static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args) Boolean _rv; short fontNum; short size; +#ifndef RealFont + PyMac_PRECHECK(RealFont); +#endif if (!PyArg_ParseTuple(_args, "hh", &fontNum, &size)) @@ -126,6 +138,9 @@ static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean lockFlag; +#ifndef SetFontLock + PyMac_PRECHECK(SetFontLock); +#endif if (!PyArg_ParseTuple(_args, "b", &lockFlag)) return NULL; @@ -140,6 +155,9 @@ static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean fscaleDisable; +#ifndef SetFScaleDisable + PyMac_PRECHECK(SetFScaleDisable); +#endif if (!PyArg_ParseTuple(_args, "b", &fscaleDisable)) return NULL; @@ -153,6 +171,9 @@ static PyObject *Fm_FontMetrics(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; FMetricRec theMetrics; +#ifndef FontMetrics + PyMac_PRECHECK(FontMetrics); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; FontMetrics(&theMetrics); @@ -165,6 +186,9 @@ static PyObject *Fm_SetFractEnable(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean fractEnable; +#ifndef SetFractEnable + PyMac_PRECHECK(SetFractEnable); +#endif if (!PyArg_ParseTuple(_args, "b", &fractEnable)) return NULL; @@ -178,6 +202,9 @@ static PyObject *Fm_GetDefFontSize(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; +#ifndef GetDefFontSize + PyMac_PRECHECK(GetDefFontSize); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetDefFontSize(); @@ -192,6 +219,9 @@ static PyObject *Fm_IsOutline(PyObject *_self, PyObject *_args) Boolean _rv; Point numer; Point denom; +#ifndef IsOutline + PyMac_PRECHECK(IsOutline); +#endif if (!PyArg_ParseTuple(_args, "O&O&", PyMac_GetPoint, &numer, PyMac_GetPoint, &denom)) @@ -207,6 +237,9 @@ static PyObject *Fm_SetOutlinePreferred(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean outlinePreferred; +#ifndef SetOutlinePreferred + PyMac_PRECHECK(SetOutlinePreferred); +#endif if (!PyArg_ParseTuple(_args, "b", &outlinePreferred)) return NULL; @@ -220,6 +253,9 @@ static PyObject *Fm_GetOutlinePreferred(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; +#ifndef GetOutlinePreferred + PyMac_PRECHECK(GetOutlinePreferred); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetOutlinePreferred(); @@ -232,6 +268,9 @@ static PyObject *Fm_SetPreserveGlyph(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean preserveGlyph; +#ifndef SetPreserveGlyph + PyMac_PRECHECK(SetPreserveGlyph); +#endif if (!PyArg_ParseTuple(_args, "b", &preserveGlyph)) return NULL; @@ -245,6 +284,9 @@ static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; +#ifndef GetPreserveGlyph + PyMac_PRECHECK(GetPreserveGlyph); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetPreserveGlyph(); @@ -259,6 +301,9 @@ static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; +#ifndef FlushFonts + PyMac_PRECHECK(FlushFonts); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _err = FlushFonts(); @@ -273,6 +318,9 @@ static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; +#ifndef GetSysFont + PyMac_PRECHECK(GetSysFont); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetSysFont(); @@ -285,6 +333,9 @@ static PyObject *Fm_GetAppFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; +#ifndef GetAppFont + PyMac_PRECHECK(GetAppFont); +#endif if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetAppFont(); @@ -300,6 +351,9 @@ static PyObject *Fm_QDTextBounds(PyObject *_self, PyObject *_args) int inText__len__; int inText__in_len__; Rect bounds; +#ifndef QDTextBounds + PyMac_PRECHECK(QDTextBounds); +#endif if (!PyArg_ParseTuple(_args, "s#", &inText__in__, &inText__in_len__)) return NULL; |