diff options
| author | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-10 18:23:39 +0000 |
|---|---|---|
| committer | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-10 18:23:39 +0000 |
| commit | 8f0b05258437cc12e4fb48171a638f4e98e74f10 (patch) | |
| tree | 5934090e772e41a4b3f75a7744a031f4576d60b1 /ext/dl/sample | |
| parent | 1e37c683c1d1debfdf1da043bec2cf5159bb073b (diff) | |
| download | ruby-8f0b05258437cc12e4fb48171a638f4e98e74f10.tar.gz ruby-8f0b05258437cc12e4fb48171a638f4e98e74f10.tar.xz ruby-8f0b05258437cc12e4fb48171a638f4e98e74f10.zip | |
bugfix.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/sample')
| -rw-r--r-- | ext/dl/sample/libc.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/dl/sample/libc.rb b/ext/dl/sample/libc.rb index 9975828be..32816fd33 100644 --- a/ext/dl/sample/libc.rb +++ b/ext/dl/sample/libc.rb @@ -35,6 +35,11 @@ module LIBC "int tz_minuteswest", "int tz_dsttime", ] + + def my_compare(ptr1, ptr2) + ptr1.ptr.to_s <=> ptr2.ptr.to_s + end + COMPARE = callback "int my_compare(char**, char**)" end @@ -54,7 +59,7 @@ p LIBC.strcat("a", "b") ary = ["a","c","b"] ptr = ary.to_ptr -LIBC.qsort(ptr, ary.length, DL.sizeof('P'), $cb1) +LIBC.qsort(ptr, ary.length, DL.sizeof('P'), LIBC::COMPARE) p ptr.to_a('S', ary.length) tv = LIBC::Timeval.malloc |
