Commit 5349e064 authored by Manuel Odendahl's avatar Manuel Odendahl
Browse files

cl-gd fixes zum laufen auf 64bit openmcl, *cough*

git-svn-id: svn://bknr.net/svn/trunk/thirdparty/cl-gd@4605 4281704c-cde7-0310-8518-8e2dc76b1ff0
parent 520d11db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,4 +8,4 @@ cl-gd-glue.so:
# this should work for Mac OS X

cl-gd-glue.dylib:
	gcc -arch i386 -lgd -lpng -lz -lfreetype -ljpeg -dynamiclib cl-gd-glue.c -o cl-gd-glue.dylib -I/opt/local/include -L/opt/local/lib
	gcc -arch i386 -arch x86_64 -lgif -lgd -lpng -lz -lfreetype -ljpeg -dynamiclib cl-gd-glue.c -o cl-gd-glue.dylib -I/opt/local/include -L/opt/local/lib
+7 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
  (sx :int)
  (sy :int)
  (colors-total :int)
  (red (:array :int #.+max-colors+))
  (red (:array :int #.+max-colors+) :offset 20)
  (green (:array :int #.+max-colors+))
  (blue (:array :int #.+max-colors+))
  (open (:array :int #.+max-colors+))
@@ -74,6 +74,12 @@
  (cx2 :int)
  (cy2 :int))

;; XXX evil hack
#+(and :openmcl :64-bit-target)
(defmethod cffi::foreign-type-alignment ((type uffi-array-type))
  4)


(def-type pixels-array (* (* :unsigned-char)))
(def-type pixels-row (* :unsigned-char))
(def-type t-pixels-array (* (* :int)))
+2 −2
Original line number Diff line number Diff line
@@ -220,12 +220,12 @@ destination image."
                (let ((,raw-pixels (get-slot-value ,img 'gd-image 'pixels)))
                  (declare (type pixels-array ,raw-pixels))
                  (dotimes (,y-var ,height)
                    (let ((,row (deref-array ,raw-pixels '(:array (* :unsigned-char)) ,y-var)))
                    (let ((,row (deref-array ,raw-pixels '(:array (* :unsigned-byte)) ,y-var)))
                      (declare (type pixels-row ,row))
                      (macrolet ((do-pixels-in-row ((,x-var) &body ,inner-body)
                                   `(dotimes (,,x-var ,',width)
                                     (macrolet ((raw-pixel ()
                                                  `(deref-array ,',',row '(:array :unsigned-char) ,',,x-var)))
                                                  `(deref-array ,',',row '(:array :unsigned-byte) ,',,x-var)))
                                       (locally
                                         ,@,inner-body)))))
                        (locally