[Openmcl-cvs-notifications] r12643 - /trunk/source/objc-bridge/objc-runtime.lisp

gb at clozure.com gb at clozure.com
Fri Aug 21 16:20:08 EDT 2009


Author: gb
Date: Fri Aug 21 16:20:08 2009
New Revision: 12643

Log:
Tweak the code that loads the Cocoa framework, so that standalone
Cocotron apps don't try to add "ccl:cocotron;" to the PATH.

Modified:
    trunk/source/objc-bridge/objc-runtime.lisp

Modified: trunk/source/objc-bridge/objc-runtime.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/objc-bridge/objc-runtime.lisp (original)
+++ trunk/source/objc-bridge/objc-runtime.lisp Fri Aug 21 16:20:08 2009
@@ -387,7 +387,7 @@
     (car success)))
 =

 =

-(def-ccl-pointers cocoa-framework ()
+(defun load-cocoa-framework ()
   (run-in-cocoa-process-and-wait
    #'(lambda ()
        ;; We need to load and "initialize" the CoreFoundation library
@@ -396,28 +396,38 @@
        #+apple-objc
        (open-shared-library "/System/Library/Frameworks/Cocoa.framework/Co=
coa")
        #+cocotron-objc
-       (let* ((path (getenv "PATH")))
-         (unwind-protect
+       (progn
+         (open-shared-library "Foundation.1.0.dll")
+         (open-shared-library "AppKit.1.0.dll")
+         ;; We may need to call #_NSInitializeProcess
+         ;; under Cocotron.  If so, we'd need to do
+         ;; so on standalone startup, too, and would
+         ;; have to heap-allocated the string vector
+         ;; and its strings.
+         #+notyet
+         (with-string-vector (argv (kernel-path))
+           (#_NSInitializeProcess 1 argv)))
+         =

+       ;(#_GetCurrentEventQueue)
+       (current-ns-thread)
+       (create-void-nsthread))))
+
+(pushnew #'load-cocoa-framework *lisp-system-pointer-functions* :key #'fun=
ction-name)
+
+#-cocotron
+(load-cocoa-framework)
+
+#+cocotron
+(let* ((path (getenv "PATH")))
+           (unwind-protect
               (progn
                 (setenv "PATH"
                         (format nil "~a;~a"
                                 (native-translated-namestring
                                  (truename "ccl:cocotron;"))
                                 path))
-                (open-shared-library "Foundation.1.0.dll")
-                (open-shared-library "AppKit.1.0.dll")
-                ;; We may need to call #_NSInitializeProcess
-                ;; under Cocotron.  If so, we'd need to do
-                ;; so on standalone startup, too, and would
-                ;; have to heap-allocated the string vector
-                ;; and its strings.
-                #+notyet
-                (with-string-vector (argv (kernel-path))
-                  (#_NSInitializeProcess 1 argv)))
+                (load-cocoa-framework))
            (setenv "PATH" path)))
-       ;(#_GetCurrentEventQueue)
-       (current-ns-thread)
-       (create-void-nsthread))))
 =

 =

 (defun find-cfstring-sections ()



More information about the Openmcl-cvs-notifications mailing list