Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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
  • Loading branch information...
commit 5349e064c36c3555234e39f354d87c48e030df4a 1 parent 520d11d
Manuel Odendahl authored
Showing with 10 additions and 4 deletions.
  1. +1 −1  Makefile
  2. +7 −1 gd-uffi.lisp
  3. +2 −2 misc.lisp
View
2  Makefile
@@ -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
View
8 gd-uffi.lisp
@@ -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)))
View
4 misc.lisp
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.