patch-ext_openssl_ossl_c 955 B

1234567891011121314151617181920212223242526272829
  1. --- ruby-1.9.1-p378.orig/ext/openssl/ossl.c 2009-01-15 16:39:30.000000000 +0100
  2. +++ ruby-1.9.1-p378/ext/openssl/ossl.c 2010-06-12 21:01:58.171613505 +0200
  3. @@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary)
  4. #define OSSL_IMPL_SK2ARY(name, type) \
  5. VALUE \
  6. -ossl_##name##_sk2ary(STACK *sk) \
  7. +ossl_##name##_sk2ary(STACK_OF(type) *sk) \
  8. { \
  9. type *t; \
  10. int i, num; \
  11. @@ -102,7 +102,7 @@ ossl_##name##_sk2ary(STACK *sk) \
  12. OSSL_Debug("empty sk!"); \
  13. return Qnil; \
  14. } \
  15. - num = sk_num(sk); \
  16. + num = sk_##type##_num(sk); \
  17. if (num < 0) { \
  18. OSSL_Debug("items in sk < -1???"); \
  19. return rb_ary_new(); \
  20. @@ -110,7 +110,7 @@ ossl_##name##_sk2ary(STACK *sk) \
  21. ary = rb_ary_new2(num); \
  22. \
  23. for (i=0; i<num; i++) { \
  24. - t = (type *)sk_value(sk, i); \
  25. + t = sk_##type##_value(sk, i); \
  26. rb_ary_push(ary, ossl_##name##_new(t)); \
  27. } \
  28. return ary; \