summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/res
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2008-06-05 12:58:24 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2008-06-05 12:58:24 (GMT)
commit5640ce2f1edc0148ee14fd3daeb7ac700700bb71 (patch)
tree9bc8b41710d3a86ccbb579a0209928d787386b69 /Mac/Modules/res
parent80af6da7489c3b28e0a46c73849da34273972e3b (diff)
downloadcpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.zip
cpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.tar.gz
cpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.tar.bz2
MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX: --with-universal-archs=[32-bit|64-bit|all] When used with the --enable-universalsdk option this controls which CPU architectures are includes in the framework. The default is 32-bit, meaning i386 and ppc. The most useful alternative is 'all', which includes all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64). This includes limited support for the Carbon bindings in 64-bit mode as well, limited because (a) I haven't done extensive testing and (b) a large portion of the Carbon API's aren't available in 64-bit mode anyway. I've also duplicated a feature of Apple's build of python: setting the environment variable 'ARCHFLAGS' controls the '-arch' flags used for building extensions using distutils.
Diffstat (limited to 'Mac/Modules/res')
-rw-r--r--Mac/Modules/res/_Resmodule.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c
index 011c575..207037a 100644
--- a/Mac/Modules/res/_Resmodule.c
+++ b/Mac/Modules/res/_Resmodule.c
@@ -4,7 +4,6 @@
#include "Python.h"
-
#include "pymactoolbox.h"
/* Macro to test whether a weak-loaded CFM function exists */
@@ -414,6 +413,7 @@ static PyObject *ResObj_GetNextFOND(ResourceObject *_self, PyObject *_args)
return _res;
}
+#ifndef __LP64__
static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -431,6 +431,7 @@ static PyObject *ResObj_as_Menu(ResourceObject *_self, PyObject *_args)
return _res;
}
+#endif /* !__LP64__ */
static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
{
@@ -501,10 +502,12 @@ static PyMethodDef ResObj_methods[] = {
PyDoc_STR("(long newSize) -> None")},
{"GetNextFOND", (PyCFunction)ResObj_GetNextFOND, 1,
PyDoc_STR("() -> (Handle _rv)")},
+#ifndef __LP64__
{"as_Control", (PyCFunction)ResObj_as_Control, 1,
PyDoc_STR("Return this resource/handle as a Control")},
{"as_Menu", (PyCFunction)ResObj_as_Menu, 1,
PyDoc_STR("Return this resource/handle as a Menu")},
+#endif /* !__LP64__ */
{"LoadResource", (PyCFunction)ResObj_LoadResource, 1,
PyDoc_STR("() -> None")},
{"AutoDispose", (PyCFunction)ResObj_AutoDispose, 1,
@@ -1152,6 +1155,7 @@ static PyObject *Res_SetResFileAttrs(PyObject *_self, PyObject *_args)
return _res;
}
+#ifndef __LP64__
static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1287,6 +1291,7 @@ static PyObject *Res_FSpCreateResFile(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
+#endif /* !__LP64__ */
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
{
@@ -1327,6 +1332,7 @@ static PyObject *Res_DetachResourceFile(PyObject *_self, PyObject *_args)
return _res;
}
+#ifndef __LP64__
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1394,6 +1400,7 @@ static PyObject *Res_GetTopResourceFile(PyObject *_self, PyObject *_args)
return _res;
}
+
static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1413,6 +1420,7 @@ static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
nextRefNum);
return _res;
}
+#endif /* !__LP64__ */
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
{
@@ -1438,6 +1446,8 @@ static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
return _res;
}
+
+#ifndef __LP64__
static PyObject *Res_FSCreateResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1534,6 +1544,7 @@ static PyObject *Res_FSCreateResourceFile(PyObject *_self, PyObject *_args)
PyMac_BuildFSSpec, &newSpec);
return _res;
}
+#endif /* __LP64__ */
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
{
@@ -1544,7 +1555,7 @@ static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
UniCharCount forkNameLength__len__;
int forkNameLength__in_len__;
SignedByte permissions;
- SInt16 refNum;
+ ResFileRefNum refNum;
#ifndef FSOpenResourceFile
PyMac_PRECHECK(FSOpenResourceFile);
#endif
@@ -1637,6 +1648,7 @@ static PyMethodDef Res_methods[] = {
PyDoc_STR("(short refNum) -> (short _rv)")},
{"SetResFileAttrs", (PyCFunction)Res_SetResFileAttrs, 1,
PyDoc_STR("(short refNum, short attrs) -> None")},
+#ifndef __LP64__
{"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
{"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
@@ -1647,10 +1659,12 @@ static PyMethodDef Res_methods[] = {
PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
{"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
+#endif /* !__LP64__ */
{"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
{"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
PyDoc_STR("(SInt16 refNum) -> None")},
+#ifndef __LP64__
{"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
{"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
@@ -1659,14 +1673,17 @@ static PyMethodDef Res_methods[] = {
PyDoc_STR("() -> (SInt16 refNum)")},
{"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
+#endif /* __LP64__ */
{"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
+#ifndef __LP64__
{"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
{"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
{"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
+#endif /* __LP64__ */
{"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
{"Handle", (PyCFunction)Res_Handle, 1,
@@ -1676,7 +1693,6 @@ static PyMethodDef Res_methods[] = {
-
/* Alternative version of ResObj_New, which returns None for null argument */
PyObject *OptResObj_New(Handle itself)
{