[Python-checkins] r75018 - in python/branches/release26-maint: Mac/Modules/Nav.c

ronald.oussoren python-checkins at python.org
Tue Sep 22 16:26:55 CEST 2009


Author: ronald.oussoren
Date: Tue Sep 22 16:26:55 2009
New Revision: 75018

Log:
Merged revisions 75017 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75017 | ronald.oussoren | 2009-09-22 16:24:57 +0200 (Tue, 22 Sep 2009) | 4 lines
  
  The 'Navigation Toolbox' is not available at all for 64-bit 
  code, make this explicit in the C code to avoid confusing
  error messages during the build.
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Mac/Modules/Nav.c

Modified: python/branches/release26-maint/Mac/Modules/Nav.c
==============================================================================
--- python/branches/release26-maint/Mac/Modules/Nav.c	(original)
+++ python/branches/release26-maint/Mac/Modules/Nav.c	Tue Sep 22 16:26:55 2009
@@ -33,6 +33,8 @@
 #include "pymactoolbox.h"
 #include <Carbon/Carbon.h>
 
+#ifndef __LP64__
+
 static PyObject *ErrorObject;
 
 static NavEventUPP my_eventProcUPP;
@@ -184,22 +186,18 @@
 		} else if( strcmp(keystr, "preferenceKey") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, &opt->preferenceKey) )
 				return 0;
-#ifndef __LP64__
 		} else if( strcmp(keystr, "popupExtension") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", ResObj_Convert, &opt->popupExtension) )
 				return 0;
-#endif /* !__LP64__ */
 		} else if( eventProcP && strcmp(keystr, "eventProc") == 0 ) {
 			*eventProcP = my_eventProcUPP;
 		} else if( previewProcP && strcmp(keystr, "previewProc") == 0 ) {
 			*previewProcP = my_previewProcUPP;
 		} else if( filterProcP && strcmp(keystr, "filterProc") == 0 ) {
 			*filterProcP = my_filterProcUPP;
-#ifndef __LP64__
 		} else if( typeListP && strcmp(keystr, "typeList") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", ResObj_Convert, typeListP) )
 				return 0;
-#endif /* !__LP64__ */
 		} else if( fileTypeP && strcmp(keystr, "fileType") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, fileTypeP) )
 				return 0;
@@ -306,22 +304,14 @@
 navrr_getattr(navrrobject *self, char *name)
 {
 	FSRef fsr;
-#ifndef __LP64__
 	FSSpec fss;
-#endif /* !__LP64__ */
 	
 	if( strcmp(name, "__members__") == 0 )
 		return Py_BuildValue(
-#ifndef __LP64__
-				"ssssssssss", 
-#else /* __LP64__ */
 				"ssssssssss", 
-#endif /* __LP64__ */
 				"version", "validRecord", "replacing",
 			"isStationery", "translationNeeded", 
-#ifndef __LP64__
 			"selection", 
-#endif /* !__LP64__ */
 			"selection_fsr",
 			"fileTranslation", "keyScript", "saveFileName");
 
@@ -335,7 +325,6 @@
 		return Py_BuildValue("l", (long)self->itself.isStationery);
 	if( strcmp(name, "translationNeeded") == 0 )
 		return Py_BuildValue("l", (long)self->itself.translationNeeded);
-#ifndef __LP64__
 	if( strcmp(name, "selection") == 0 ) {
 		SInt32 i;
 		long count;
@@ -367,7 +356,6 @@
 		}
 		return rv;
 	}
-#endif /* !__LP64__ */
 	if( strcmp(name, "selection_fsr") == 0 ) {
 		SInt32 i;
 		long count;
@@ -399,10 +387,8 @@
 		}
 		return rv;
 	}
-#ifndef __LP64__
 	if( strcmp(name, "fileTranslation") == 0 )
 		return ResObj_New((Handle)self->itself.fileTranslation);
-#endif
 	if( strcmp(name, "keyScript") == 0 )
 		return Py_BuildValue("h", (short)self->itself.keyScript);
 	if( strcmp(name, "saveFileName") == 0 )
@@ -885,11 +871,7 @@
 		return NULL;
 	}
 	return Py_BuildValue(
-#ifndef __LP64__
 			"{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
-#else /* __LP64__ */
-			"{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
-#endif /* __LP64__ */
 		"version", dialogOptions.version,
 		"dialogOptionFlags", dialogOptions.dialogOptionFlags,
 		"location", PyMac_BuildPoint, dialogOptions.location,
@@ -900,9 +882,7 @@
 		"savedFileName", PyMac_BuildStr255, &dialogOptions.savedFileName,
 		"message", PyMac_BuildStr255, &dialogOptions.message,
 		"preferenceKey", PyMac_BuildOSType, dialogOptions.preferenceKey
-#ifndef __LP64__
 		,"popupExtension", OptResObj_New, dialogOptions.popupExtension
-#endif /* __LP64__ */
 		);
 }
 
@@ -943,6 +923,10 @@
 "Pass None as eventProc to get movable-modal dialogs that process updates through the standard Python mechanism."
 ;
 
+
+#endif /* !__LP64__ */
+
+
 void
 initNav(void)
 {
@@ -951,6 +935,12 @@
 	if (PyErr_WarnPy3k("In 3.x, Nav is removed.", 1))
 		return;
 
+#ifdef __LP64__
+	PyErr_SetString(PyExc_ImportError, "Navigation Services not available in 64-bit mode");
+	return;
+
+#else	/* !__LP64__ */
+
 	/* Test that we have NavServices */
 	if ( !NavServicesAvailable() ) {
 		PyErr_SetString(PyExc_ImportError, "Navigation Services not available");
@@ -972,6 +962,7 @@
 	my_eventProcUPP = NewNavEventUPP(my_eventProc);
 	my_previewProcUPP = NewNavPreviewUPP(my_previewProc);
 	my_filterProcUPP = NewNavObjectFilterUPP(my_filterProc);
+#endif /* !__LP64__ */
 	
 }
 


More information about the Python-checkins mailing list