Commits

Bob Ippolito  committed 2cee29a

wrap loadBundle(Functions|Variables) with #ifdef MACOSX

  • Participants
  • Parent commits 81afb10
  • Branches pyobjc-ancient

Comments (0)

Files changed (3)

File Modules/objc/bundle-variables.h

 #ifndef PyObjC_BUNDLE_VARIABLES_H
 #define PyObjC_BUNDLE_VARIABLES_H
+#ifdef MACOSX
 
 PyObject* PyObjC_loadBundleVariables(PyObject* self __attribute__((__unused__)),
 		PyObject* args, PyObject* kwds);
 PyObject* PyObjC_loadBundleFunctions(PyObject* self __attribute__((__unused__)),
 		PyObject* args, PyObject* kwds);
 
+#endif
 #endif /* PyObjC_BUNDLE_VARIABLES_H */

File Modules/objc/bundle-variables.m

  * NOTE: The interface is specified with NSBundles, but we have to 
  * use CFBundles in the implementation. This is not portable to GNUstep :-(
  */
+#ifdef MACOSX
 #include "pyobjc.h"
 
 #include <CoreFoundation/CoreFoundation.h>
 	Py_INCREF(Py_None);
 	return Py_None;
 }
+#endif /* MACOSX */

File Modules/objc/module.m

 
 #ifdef MACOSX
 
+PyDoc_STRVAR(PyObjC_loadBundleVariables_doc, 
+	"loadBundleVariables(bundle, module_globals, variableInfo, "
+	"skip_undefined=True)\n"
+	"\n"
+	"Load the specified variables in the bundle. If skip_undefined is \n"
+	"True, variables that are not present in the bundle are skipped, \n"
+	"otherwise this method raises objc.error when a variable cannot be \n"
+	"found.\n"
+	"\n"
+	"variableInfo is a list of (name, type) pairs. The type is the \n"
+	"Objective-C type specifier for the variable type.");
+PyDoc_STRVAR(PyObjC_loadBundleFunctions_doc,
+	"loadBundleFunctions(bundle, module_globals, functionInfo, "
+	"skip_undefined=True)\n"
+	"\n"
+	"Load the specified functions in the bundle. If skip_undefined is \n"
+	"True, variables that are not present in the bundle are skipped, \n"
+	"otherwise this method raises objc.error when a variable cannot be \n"
+	"found.\n"
+	"\n"    
+	"variableInfo is a list of (name, signature, doc) triples. \n"
+	"The signature is the Objective-C type specifier for the function \n"
+	"signature.");
+
 PyDoc_STRVAR(objc_CFToObject_doc,
 	"CFToObject(cfObject) -> objCObject\n"
 	"\n"
 }
 
 
-PyDoc_STRVAR(PyObjC_loadBundleVariables_doc, 
-	"loadBundleVariables(bundle, module_globals, variableInfo, "
-	"skip_undefined=True)\n"
-	"\n"
-	"Load the specified variables in the bundle. If skip_undefined is \n"
-	"True, variables that are not present in the bundle are skipped, \n"
-	"otherwise this method raises objc.error when a variable cannot be \n"
-	"found.\n"
-	"\n"
-	"variableInfo is a list of (name, type) pairs. The type is the \n"
-	"Objective-C type specifier for the variable type.");
-PyDoc_STRVAR(PyObjC_loadBundleFunctions_doc,
-	"loadBundleFunctions(bundle, module_globals, functionInfo, "
-	"skip_undefined=True)\n"
-	"\n"
-	"Load the specified functions in the bundle. If skip_undefined is \n"
-	"True, variables that are not present in the bundle are skipped, \n"
-	"otherwise this method raises objc.error when a variable cannot be \n"
-	"found.\n"
-	"\n"    
-	"variableInfo is a list of (name, signature, doc) triples. \n"
-	"The signature is the Objective-C type specifier for the function \n"
-	"signature.");
-
 static PyMethodDef mod_methods[] = {
 	{
 	  "splitSignature",
 	{ "getStrBridgeEnabled", (PyCFunction)getStrBridgeEnabled, METH_VARARGS|METH_KEYWORDS, getStrBridgeEnabled_doc },
 	{ "loadBundle", (PyCFunction)loadBundle, METH_VARARGS|METH_KEYWORDS, loadBundle_doc },
 	{ "allocateBuffer", (PyCFunction)allocateBuffer, METH_VARARGS|METH_KEYWORDS, allocateBuffer_doc },
-
+	{ "enableThreading", (PyCFunction)enableThreading, METH_NOARGS, enableThreading_doc },
+	{ "protocolsForClass", (PyCFunction)protocolsForClass, METH_VARARGS|METH_KEYWORDS, protocolsForClass_doc },
 #ifdef MACOSX
 	{ "CFToObject", (PyCFunction)objc_CFToObject, METH_VARARGS|METH_KEYWORDS, objc_CFToObject_doc },
 	{ "ObjectToCF", (PyCFunction)objc_ObjectToCF, METH_VARARGS|METH_KEYWORDS, objc_ObjectToCF_doc },
+	{ "loadBundleVariables", (PyCFunction)PyObjC_loadBundleVariables,
+		METH_VARARGS|METH_KEYWORDS, PyObjC_loadBundleVariables_doc },
+	{ "loadBundleFunctions", (PyCFunction)PyObjC_loadBundleFunctions,
+		METH_VARARGS|METH_KEYWORDS, PyObjC_loadBundleFunctions_doc },
 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
 	{ "inject", (PyCFunction)pyject_inject, METH_VARARGS|METH_KEYWORDS, inject_doc },
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3 */
 #endif /* MACOSX */
-	{ "enableThreading", (PyCFunction)enableThreading, METH_NOARGS, enableThreading_doc },
-	{ "protocolsForClass", (PyCFunction)protocolsForClass, METH_VARARGS|METH_KEYWORDS, protocolsForClass_doc },
-	{ "loadBundleVariables", (PyCFunction)PyObjC_loadBundleVariables,
-		METH_VARARGS|METH_KEYWORDS, PyObjC_loadBundleVariables_doc },
-	{ "loadBundleFunctions", (PyCFunction)PyObjC_loadBundleFunctions,
-		METH_VARARGS|METH_KEYWORDS, PyObjC_loadBundleFunctions_doc },
 
 	{ 0, 0, 0, 0 } /* sentinel */
 };