mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_pkey.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
39f90db925
commit
66541b9a83
2 changed files with 12 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Mar 1 22:29:10 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_pkey.h: parenthesize macro arguments.
|
||||||
|
|
||||||
Tue Mar 1 22:02:35 2011 Shota Fukumori <sorah@tubusu.net>
|
Tue Mar 1 22:02:35 2011 Shota Fukumori <sorah@tubusu.net>
|
||||||
|
|
||||||
* lib/test/unit/parallel.rb: Fix number.
|
* lib/test/unit/parallel.rb: Fix number.
|
||||||
|
|
|
@ -21,21 +21,21 @@ extern ID id_private_q;
|
||||||
#define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)
|
#define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)
|
||||||
|
|
||||||
#define WrapPKey(klass, obj, pkey) do { \
|
#define WrapPKey(klass, obj, pkey) do { \
|
||||||
if (!pkey) { \
|
if (!(pkey)) { \
|
||||||
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
|
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
|
||||||
} \
|
} \
|
||||||
obj = Data_Wrap_Struct(klass, 0, EVP_PKEY_free, pkey); \
|
(obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
|
||||||
OSSL_PKEY_SET_PUBLIC(obj); \
|
OSSL_PKEY_SET_PUBLIC(obj); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define GetPKey(obj, pkey) do {\
|
#define GetPKey(obj, pkey) do {\
|
||||||
Data_Get_Struct(obj, EVP_PKEY, pkey);\
|
Data_Get_Struct((obj), EVP_PKEY, (pkey));\
|
||||||
if (!pkey) { \
|
if (!(pkey)) { \
|
||||||
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
|
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define SafeGetPKey(obj, pkey) do { \
|
#define SafeGetPKey(obj, pkey) do { \
|
||||||
OSSL_Check_Kind(obj, cPKey); \
|
OSSL_Check_Kind((obj), cPKey); \
|
||||||
GetPKey(obj, pkey); \
|
GetPKey((obj), (pkey)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
void ossl_generate_cb(int, int, void *);
|
void ossl_generate_cb(int, int, void *);
|
||||||
|
@ -134,8 +134,8 @@ static VALUE ossl_##keytype##_set_##name(VALUE self, VALUE bignum) \
|
||||||
|
|
||||||
#define DEF_OSSL_PKEY_BN(class, keytype, name) \
|
#define DEF_OSSL_PKEY_BN(class, keytype, name) \
|
||||||
do { \
|
do { \
|
||||||
rb_define_method(class, #name, ossl_##keytype##_get_##name, 0); \
|
rb_define_method((class), #name, ossl_##keytype##_get_##name, 0); \
|
||||||
rb_define_method(class, #name "=", ossl_##keytype##_set_##name, 1);\
|
rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#endif /* _OSSL_PKEY_H_ */
|
#endif /* _OSSL_PKEY_H_ */
|
||||||
|
|
Loading…
Reference in a new issue