git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit c1a696d90fd2c584709b638d4d3e77030b79f251

Fixed Ruby 1.8.5 compatibility.

Thanks to Mike Pomraning for the patch.
Coda Hale committed on 3/11/2009, 7:40:33 PM
Parent: 18178defdd85fcde985e0f010666d8aa54819a48

Files changed

ext/bcrypt_ext.cchanged
ext/bcrypt_ext.cView
@@ -6,8 +6,14 @@
66
77 VALUE mBCrypt;
88 VALUE cBCryptEngine;
99
10+/* Define RSTRING_PTR for Ruby 1.8.5, ruby-core's idea of a point release is
11+ insane. */
12+#ifndef RSTRING_PTR
13+# define RSTRING_PTR(s) (RSTRING(s)->ptr)
14+#endif
15+
1016 /* Given a logarithmic cost parameter, generates a salt for use with +bc_crypt+.
1117 */
1218 static VALUE bc_salt(VALUE self, VALUE cost, VALUE seed) {
1319 return rb_str_new2((char *)bcrypt_gensalt(NUM2INT(cost), (u_int8_t *)RSTRING_PTR(seed)));

Built with git-ssb-web