projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d03c525
)
Added %set-alien/address!, for gtk/gio.scm.
author
Matt Birkholz
<matt@birkholz.chandler.az.us>
Wed, 22 Jun 2011 14:58:06 +0000
(07:58 -0700)
committer
Matt Birkholz
<matt@birkholz.chandler.az.us>
Wed, 22 Jun 2011 14:58:06 +0000
(07:58 -0700)
Needed to create an alien address from an external-string descriptor.
src/runtime/ffi.scm
patch
|
blob
|
history
diff --git
a/src/runtime/ffi.scm
b/src/runtime/ffi.scm
index 220e810a8998600926b5e48ebc6040b677895169..55db9b89bc02ef8980a0dabc857cd3461ac24c45 100644
(file)
--- a/
src/runtime/ffi.scm
+++ b/
src/runtime/ffi.scm
@@
-96,6
+96,11
@@
USA.
(+ (* (%alien/high-bits alien) (radix))
(%alien/low-bits alien)))
+(define (%set-alien/address! alien address)
+ (let ((qr (integer-divide address (radix))))
+ (set-%alien/high-bits! alien (integer-divide-quotient qr))
+ (set-%alien/low-bits! alien (integer-divide-remainder qr))))
+
(declare (integrate-operator copy-alien-address!))
(define (copy-alien-address! alien source)
(if (not (eq? alien source))