1
0
Fork 0
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:
akr 2011-03-15 23:41:17 +00:00
parent 3b17a84e4a
commit 9b62c58a3a
2 changed files with 15 additions and 11 deletions

View file

@ -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.

View file

@ -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)