Ignore:
Timestamp:
Aug 21, 2009, 8:20:08 PM (10 years ago)
Author:
gb
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/objc-bridge/objc-runtime.lisp

    r12624 r12643  
    388388
    389389
    390 (def-ccl-pointers cocoa-framework ()
     390(defun load-cocoa-framework ()
    391391  (run-in-cocoa-process-and-wait
    392392   #'(lambda ()
     
    397397       (open-shared-library "/System/Library/Frameworks/Cocoa.framework/Cocoa")
    398398       #+cocotron-objc
    399        (let* ((path (getenv "PATH")))
    400          (unwind-protect
     399       (progn
     400         (open-shared-library "Foundation.1.0.dll")
     401         (open-shared-library "AppKit.1.0.dll")
     402         ;; We may need to call #_NSInitializeProcess
     403         ;; under Cocotron.  If so, we'd need to do
     404         ;; so on standalone startup, too, and would
     405         ;; have to heap-allocated the string vector
     406         ;; and its strings.
     407         #+notyet
     408         (with-string-vector (argv (kernel-path))
     409           (#_NSInitializeProcess 1 argv)))
     410         
     411       ;(#_GetCurrentEventQueue)
     412       (current-ns-thread)
     413       (create-void-nsthread))))
     414
     415(pushnew #'load-cocoa-framework *lisp-system-pointer-functions* :key #'function-name)
     416
     417#-cocotron
     418(load-cocoa-framework)
     419
     420#+cocotron
     421(let* ((path (getenv "PATH")))
     422           (unwind-protect
    401423              (progn
    402424                (setenv "PATH"
     
    405427                                 (truename "ccl:cocotron;"))
    406428                                path))
    407                 (open-shared-library "Foundation.1.0.dll")
    408                 (open-shared-library "AppKit.1.0.dll")
    409                 ;; We may need to call #_NSInitializeProcess
    410                 ;; under Cocotron.  If so, we'd need to do
    411                 ;; so on standalone startup, too, and would
    412                 ;; have to heap-allocated the string vector
    413                 ;; and its strings.
    414                 #+notyet
    415                 (with-string-vector (argv (kernel-path))
    416                   (#_NSInitializeProcess 1 argv)))
     429                (load-cocoa-framework))
    417430           (setenv "PATH" path)))
    418        ;(#_GetCurrentEventQueue)
    419        (current-ns-thread)
    420        (create-void-nsthread))))
    421431
    422432
Note: See TracChangeset for help on using the changeset viewer.