Changeset 12941
- Timestamp:
- Oct 9, 2009, 9:28:17 AM (15 years ago)
- Location:
- branches/working-0711/ccl
- Files:
-
- 1 deleted
- 6 edited
-
lib/dumplisp.lisp (modified) (7 diffs)
-
lib/ffi-darwinppc64.lisp (modified) (1 diff)
-
lib/numbers.lisp (modified) (2 diffs)
-
library/chud-metering.lisp (modified) (1 diff)
-
library/jp-encode-table.lisp (deleted)
-
library/jp-encode.lisp (modified) (4 diffs)
-
library/openmcl-gtk-support.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/lib/dumplisp.lisp
r12249 r12941 73 73 (mode #o644) 74 74 prepend-kernel 75 )75 #+windows-target (application-type :console)) 76 76 (declare (ignore toplevel-function error-handler application-class 77 77 clear-clos-caches init-file impurify)) 78 #+windows-target (check-type application-type (member :console :gui)) 78 79 (unless (probe-file (make-pathname :defaults nil 79 80 :directory (pathname-directory (translate-logical-pathname filename)))) … … 87 88 (let* ((fd (open-dumplisp-file filename 88 89 :mode mode 89 :prepend-kernel prepend-kernel))) 90 :prepend-kernel prepend-kernel 91 #+windows-target #+windows-target 92 :application-type application-type))) 90 93 (process-interrupt ip 91 94 #'(lambda () … … 109 112 (init-file nil init-file-p) 110 113 (clear-clos-caches t) 111 prepend-kernel) 112 (declare (ignore mode prepend-kernel)) 114 prepend-kernel 115 #+windows-target application-type) 116 (declare (ignore mode prepend-kernel #+windows-target application-type)) 113 117 (when (and application-class (neq (class-of *application*) 114 118 (if (symbolp application-class) … … 189 193 header-pos)))))))))) 190 194 191 192 (defun %prepend-file (out-fd in-fd len) 195 ;;; Note that Windows executable files are in what they call "PE" 196 ;;; (= "Portable Executable") format, not to be confused with the "PEF" 197 ;;; (= "PowerPC Executable Format" or "Preferred Executable Format") 198 ;;; executable format that Apple used on Classic MacOS. 199 (defun %prepend-file (out-fd in-fd len #+windows-target application-type) 193 200 (declare (fixnum out-fd in-fd len)) 194 201 (fd-lseek in-fd 0 #$SEEK_SET) 195 (let* ((bufsize (ash 1 15))) 202 (let* ((bufsize (ash 1 15)) 203 #+windows-target (first-buf t)) 196 204 (%stack-block ((buf bufsize)) 197 205 (loop … … 201 209 (if (< nread 0) 202 210 (%errno-disp nread)) 203 (let* ((nwritten (fd-write out-fd buf nread))) 211 #+windows-target 212 (when (shiftf first-buf nil) 213 (let* ((application-byte (ecase application-type 214 (:console #$IMAGE_SUBSYSTEM_WINDOWS_CUI) 215 (:gui #$IMAGE_SUBSYSTEM_WINDOWS_GUI))) 216 (offset (%get-long buf (get-field-offset #>IMAGE_DOS_HEADER.e_lfanew)))) 217 (assert (< offset bufsize) () "PE header not within first ~D bytes" bufsize) 218 (assert (= (%get-byte buf (+ offset 0)) (char-code #\P)) () 219 "File does not appear to be a PE file") 220 (assert (= (%get-byte buf (+ offset 1)) (char-code #\E)) () 221 "File does not appear to be a PE file") 222 (assert (= (%get-byte buf (+ offset 2)) 0) () 223 "File does not appear to be a PE file") 224 (assert (= (%get-byte buf (+ offset 3)) 0) () 225 "File does not appear to be a PE file") 226 ;; File is a PE file -- Windows subsystem byte goes at offset 68 in the 227 ;; "optional header" which appears right after the standard header (20 bytes) 228 ;; and the PE cookie (4 bytes) 229 (setf (%get-byte buf (+ offset 4 (record-length #>IMAGE_FILE_HEADER) (get-field-offset #>IMAGE_OPTIONAL_HEADER.Subsystem) )) application-byte))) 230 (let* ((nwritten (fd-write out-fd buf nread))) 204 231 (declare (fixnum nwritten)) 205 232 (unless (= nwritten nread) … … 221 248 222 249 223 (defun open-dumplisp-file (path &key (mode #o666) prepend-kernel) 250 (defun open-dumplisp-file (path &key (mode #o666) prepend-kernel 251 #+windows-target application-type) 224 252 (let* ((prepend-path (if prepend-kernel 225 253 (if (eq prepend-kernel t) … … 239 267 (let* ((image-fd (fd-open filename (logior #$O_WRONLY #$O_CREAT) mode))) 240 268 (unless (>= image-fd 0) (signal-file-error image-fd filename)) 269 (when prepend-fd 270 (%prepend-file image-fd prepend-fd prepend-len #+windows-target application-type)) 241 271 (fd-chmod image-fd mode) 242 (when prepend-fd243 (%prepend-file image-fd prepend-fd prepend-len))244 272 image-fd))) 245 273 -
branches/working-0711/ccl/lib/ffi-darwinppc64.lisp
r12694 r12941 508 508 ,fp-args-ptr 509 509 ,(* 8 (1- fp-arg-num)))))))))))))) 510 (let* (( pair (list name (next-scalar-arg argtype))))510 (let* ((form (next-scalar-arg argtype))) 511 511 (when name 512 (lets name))))512 (lets (list name form))))) 513 513 #+nil 514 514 (when (or (typep argtype 'foreign-pointer-type) -
branches/working-0711/ccl/lib/numbers.lisp
r11101 r12941 47 47 (ccl:set-fpu-mode :division-by-zero division-by-zero)))) 48 48 49 49 (defconstant double-float-nan 50 #.(let ((invalid (get-fpu-mode :invalid))) 51 (unwind-protect 52 (progn 53 (set-fpu-mode :invalid nil) 54 (+ double-float-positive-infinity double-float-negative-infinity)) 55 (set-fpu-mode :invalid invalid)))) 50 56 51 57 (defun parse-float (str len off) … … 109 115 (nan 110 116 (return-from parse-float 111 (let* ((invalid (ccl:get-fpu-mode :invalid))) 112 (unwind-protect 113 (progn 114 (ccl:set-fpu-mode :invalid nil) 115 (coerce 116 ;; we could also have used a double-float-nan 117 ;; variable binding here: 118 (+ double-float-positive-infinity 119 double-float-positive-infinity) 120 type)) 121 (ccl:set-fpu-mode :invalid invalid))))) 117 (coerce double-float-nan type))) 122 118 (expt (setq expt (%i+ expt (* esign eexp)))) 123 119 (t (return-from parse-float nil))))) -
branches/working-0711/ccl/library/chud-metering.lisp
r12243 r12941 163 163 #+ppc-target 164 164 (defun identify-functions-with-pure-code () 165 (ccl: purify)165 (ccl::purify) 166 166 (multiple-value-bind (pure-low pure-high) 167 167 -
branches/working-0711/ccl/library/jp-encode.lisp
r12410 r12941 17713 17713 17714 17714 17715 (defmacro define-jp-encoding (name doc umentmax-units-per-char17715 (defmacro define-jp-encoding (name docstring aliases max-units-per-char 17716 17716 from-ucs 17717 17717 to-ucs … … 17719 17719 length-by-1st-unit) 17720 17720 `(define-character-encoding ,name 17721 ,document 17721 ,docstring 17722 :aliases ,aliases 17722 17723 :native-endianness nil 17723 17724 :max-units-per-char ,max-units-per-char … … 17909 17910 17910 17911 17911 (define-jp-encoding :euc jp17912 (define-jp-encoding :euc-jp 17912 17913 "An 8-bit, variable-length character encoding in which 17913 17914 character code points in the range #x00-#x7f can be encoded in a 17914 17915 single octet; characters with larger code values can be encoded 17915 17916 in 2 to 3 bytes." 17917 '(:eucjp) 17916 17918 3 17917 17919 ucs-to-eucjp … … 17927 17929 (t 1))) 17928 17930 17929 (define-jp-encoding : cp93217931 (define-jp-encoding :windows-31j 17930 17932 "An 8-bit, variable-length character encoding in which 17931 17933 character code points in the range #x00-#x7f can be encoded in a 17932 17934 single octet; characters with larger code values can be encoded 17933 17935 in 2 bytes." 17936 '(:cp932 :csWindows31J) 17934 17937 2 17935 17938 ucs-to-cp932 -
branches/working-0711/ccl/library/openmcl-gtk-support.lisp
r5834 r12941 24 24 25 25 (eval-when (:compile-toplevel :execute) 26 (use-interface-dir :GTK ))26 (use-interface-dir :GTK2)) 27 27 28 28 (eval-when (:compile-toplevel :load-toplevel :execute) 29 ;; I don't know why it's necessary to explicitly open 30 ;; libgdk.so (which transitively opens half a dozen 31 ;; other libraries), while opening libgtk.so by itself 32 ;; would complain about unresolved symbols from libgdk. 33 (dolist (lib '("libgdk.so" "libgtk.so")) 34 (open-shared-library lib))) 29 (open-shared-library "libgnomeui-2.so")) 35 30 36 31
Note:
See TracChangeset
for help on using the changeset viewer.
