[PyObjC-svn] r1983 - in trunk/pyobjc/pyobjc-core: . Modules/objc libffi-src/powerpc

[email protected]
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Sun Jan 20 07:38:24 2008
New Revision: 1983

Log:
pyobjc-core now compiles on Tiger, and for the most part passes
unittests.

There are some issues, but most are a known issue (BOOL vs. bool on PPC),
one needs further research and one seems to be a buggy testcase.




Modified:
   trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.h
   trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
   trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h
   trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.m
   trunk/pyobjc/pyobjc-core/Modules/objc/pyobjc-api.h
   trunk/pyobjc/pyobjc-core/libffi-src/powerpc/ppc-ffi_darwin.c
   trunk/pyobjc/pyobjc-core/setup.py

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.h
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.h	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.h	Sun Jan 20 07:38:24 2008
@@ -1,7 +1,7 @@
 #ifndef PyObjC_FFI_SUPPORT_H
 #define PyObjC_FFI_SUPPORT_H
 
-#include "ffi/ffi.h"
+#include "ffi.h"
 
 #ifndef FFI_CLOSURES
 #    error "Need FFI_CLOSURES!"

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	Sun Jan 20 07:38:24 2008
@@ -3348,7 +3348,7 @@
 	volatile int      useStret;
 	volatile int      flags;
 	SEL		  theSel;
-	int		  isUninitialized;
+	volatile int		  isUninitialized;
 	BOOL		  variadicAllArgs = NO;
 
 	/* True iff output arguments are also in the argument list */

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h	Sun Jan 20 07:38:24 2008
@@ -93,6 +93,8 @@
 extern Ivar* (*PyObjC_class_copyIvarList)(Class, unsigned int*);
 extern Protocol** (*PyObjC_class_copyProtocolList)(Class, unsigned int*);
 
+extern BOOL (*PyObjC_class_isMetaClass)(Class);
+
 extern SEL (*PyObjC_method_getName)(Method m);
 extern const char *(*PyObjC_method_getTypeEncoding)(Method m);
 extern IMP (*PyObjC_method_getImplementation)(Method m);
@@ -146,6 +148,7 @@
 #define class_copyIvarList		PyObjC_class_copyIvarList
 #define class_copyProtocolList		PyObjC_class_copyProtocolList
 #define class_conformsToProtocol	PyObjC_class_conformsToProtocol
+#define class_isMetaClass		PyObjC_class_isMetaClass
 
 #define method_getName 			PyObjC_method_getName
 #define method_getTypeEncoding   	PyObjC_method_getTypeEncoding

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.m	Sun Jan 20 07:38:24 2008
@@ -613,6 +613,12 @@
 }
 #endif
 
+static BOOL
+compat_class_isMetaClass(Class cls)
+{
+	return CLS_GETINFO(cls, CLS_META) == CLS_META;
+}
+
 static BOOL 
 compat_class_addMethodList(Class cls,
 		struct PyObjC_method* list, unsigned int count)
@@ -796,6 +802,7 @@
 		struct PyObjC_method*, unsigned int) = NULL;
 Ivar* (*PyObjC_class_copyIvarList)(Class, unsigned int*) = NULL;
 Protocol** (*PyObjC_class_copyProtocolList)(Class, unsigned int*) = NULL;
+BOOL (*PyObjC_class_isMetaClass)(Class) = NULL;
 
 SEL (*PyObjC_method_getName)(Method m) = NULL;
 IMP (*PyObjC_method_getImplementation)(Method m) = NULL;
@@ -879,6 +886,7 @@
 	SETUP(class_copyProtocolList);
 	SETUP(class_copyMethodList);
 	SETUP(class_getName);
+	SETUP(class_isMetaClass);
 
 	SETUP(method_getName);
 	SETUP(method_getTypeEncoding);

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/pyobjc-api.h
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/pyobjc-api.h	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/pyobjc-api.h	Sun Jan 20 07:38:24 2008
@@ -32,6 +32,13 @@
 #endif
 #endif
 
+#ifndef NSUInteger
+# define NSUInteger unsigned int
+#endif
+#ifndef NSInteger
+# define NSInteger int
+#endif
+
 
 #import <Foundation/NSException.h>
 
@@ -42,7 +49,7 @@
 
 
 /* threading support */
-#if 0
+#ifdef NO_OBJC2_RUNTIME
 #define PyObjC_DURING \
 		Py_BEGIN_ALLOW_THREADS \
 		NS_DURING

Modified: trunk/pyobjc/pyobjc-core/libffi-src/powerpc/ppc-ffi_darwin.c
==============================================================================
--- trunk/pyobjc/pyobjc-core/libffi-src/powerpc/ppc-ffi_darwin.c	(original)
+++ trunk/pyobjc/pyobjc-core/libffi-src/powerpc/ppc-ffi_darwin.c	Sun Jan 20 07:38:24 2008
@@ -37,10 +37,22 @@
 #include "ppc-darwin.h"
 #include <architecture/ppc/mode_independent_asm.h>
 
+#if 0
 #if defined(POWERPC_DARWIN)
 #include <libkern/OSCacheControl.h>	// for sys_icache_invalidate()
 #endif
 
+#else 
+
+/* Explicit prototype instead of including a header to allow compilation
+ * on Tiger systems.
+ */
+
+#pragma weak sys_icache_invalidate
+extern void sys_icache_invalidate(void *start, size_t len);
+
+#endif
+
 extern void ffi_closure_ASM(void);
 
 // The layout of a function descriptor.  A C function pointer really
@@ -748,7 +760,9 @@
 
 			// Flush the icache. Only necessary on Darwin.
 #if defined(POWERPC_DARWIN)
-			sys_icache_invalidate(closure->tramp, FFI_TRAMPOLINE_SIZE);
+			if (sys_icache_invalidate) {
+				sys_icache_invalidate(closure->tramp, FFI_TRAMPOLINE_SIZE);
+			}
 #else
 			flush_range(closure->tramp, FFI_TRAMPOLINE_SIZE);
 #endif

Modified: trunk/pyobjc/pyobjc-core/setup.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/setup.py	(original)
+++ trunk/pyobjc/pyobjc-core/setup.py	Sun Jan 20 07:38:24 2008
@@ -186,8 +186,6 @@
 
 EXTRA_SOURCE = FFI_SOURCE
 EXTRA_CFLAGS = FFI_CFLAGS
-#EXTRA_SOURCE = []
-#EXTRA_CFLAGS = []
 
 CorePackages = [ 'objc' ]
 objcExtension = Extension("objc._objc",

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.