mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_x509ext.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b17a84e4a
commit
9b62c58a3a
2 changed files with 15 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Mar 16 08:40:39 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/openssl/ossl_x509ext.c: parenthesize macro arguments.
|
||||
|
||||
Tue Mar 15 18:34:27 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/openssl/ossl_x509crl.c: parenthesize macro arguments.
|
||||
|
|
|
@ -11,30 +11,30 @@
|
|||
#include "ossl.h"
|
||||
|
||||
#define WrapX509Ext(klass, obj, ext) do { \
|
||||
if (!ext) { \
|
||||
if (!(ext)) { \
|
||||
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
|
||||
} \
|
||||
obj = Data_Wrap_Struct(klass, 0, X509_EXTENSION_free, ext); \
|
||||
(obj) = Data_Wrap_Struct((klass), 0, X509_EXTENSION_free, (ext)); \
|
||||
} while (0)
|
||||
#define GetX509Ext(obj, ext) do { \
|
||||
Data_Get_Struct(obj, X509_EXTENSION, ext); \
|
||||
if (!ext) { \
|
||||
Data_Get_Struct((obj), X509_EXTENSION, (ext)); \
|
||||
if (!(ext)) { \
|
||||
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
|
||||
} \
|
||||
} while (0)
|
||||
#define SafeGetX509Ext(obj, ext) do { \
|
||||
OSSL_Check_Kind(obj, cX509Ext); \
|
||||
GetX509Ext(obj, ext); \
|
||||
OSSL_Check_Kind((obj), cX509Ext); \
|
||||
GetX509Ext((obj), (ext)); \
|
||||
} while (0)
|
||||
#define MakeX509ExtFactory(klass, obj, ctx) do { \
|
||||
if (!(ctx = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
|
||||
if (!((ctx) = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
|
||||
ossl_raise(rb_eRuntimeError, "CTX wasn't allocated!"); \
|
||||
X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, 0); \
|
||||
obj = Data_Wrap_Struct(klass, 0, ossl_x509extfactory_free, ctx); \
|
||||
X509V3_set_ctx((ctx), NULL, NULL, NULL, NULL, 0); \
|
||||
(obj) = Data_Wrap_Struct((klass), 0, ossl_x509extfactory_free, (ctx)); \
|
||||
} while (0)
|
||||
#define GetX509ExtFactory(obj, ctx) do { \
|
||||
Data_Get_Struct(obj, X509V3_CTX, ctx); \
|
||||
if (!ctx) { \
|
||||
Data_Get_Struct((obj), X509V3_CTX, (ctx)); \
|
||||
if (!(ctx)) { \
|
||||
ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
|
Loading…
Add table
Reference in a new issue