1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/ossl_ocsp.c: parenthesize macro arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-02-28 07:46:16 +00:00
parent b38b837066
commit 3fec2bee37
2 changed files with 28 additions and 24 deletions

View file

@ -1,3 +1,7 @@
Mon Feb 28 16:38:56 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_ocsp.c: parenthesize macro arguments.
Mon Feb 28 13:02:15 2011 Danial Pearce <github@tigris.id.au> Mon Feb 28 13:02:15 2011 Danial Pearce <github@tigris.id.au>
* lib/tempfile.rb: Fix example file paths in docs for tempfile. * lib/tempfile.rb: Fix example file paths in docs for tempfile.

View file

@ -14,55 +14,55 @@
#if defined(OSSL_OCSP_ENABLED) #if defined(OSSL_OCSP_ENABLED)
#define WrapOCSPReq(klass, obj, req) do { \ #define WrapOCSPReq(klass, obj, req) do { \
if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_REQUEST_free, req); \ (obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
} while (0) } while (0)
#define GetOCSPReq(obj, req) do { \ #define GetOCSPReq(obj, req) do { \
Data_Get_Struct(obj, OCSP_REQUEST, req); \ Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0) } while (0)
#define SafeGetOCSPReq(obj, req) do { \ #define SafeGetOCSPReq(obj, req) do { \
OSSL_Check_Kind(obj, cOCSPReq); \ OSSL_Check_Kind((obj), cOCSPReq); \
GetOCSPReq(obj, req); \ GetOCSPReq((obj), (req)); \
} while (0) } while (0)
#define WrapOCSPRes(klass, obj, res) do { \ #define WrapOCSPRes(klass, obj, res) do { \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_RESPONSE_free, res); \ (obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \
} while (0) } while (0)
#define GetOCSPRes(obj, res) do { \ #define GetOCSPRes(obj, res) do { \
Data_Get_Struct(obj, OCSP_RESPONSE, res); \ Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0) } while (0)
#define SafeGetOCSPRes(obj, res) do { \ #define SafeGetOCSPRes(obj, res) do { \
OSSL_Check_Kind(obj, cOCSPRes); \ OSSL_Check_Kind((obj), cOCSPRes); \
GetOCSPRes(obj, res); \ GetOCSPRes((obj), (res)); \
} while (0) } while (0)
#define WrapOCSPBasicRes(klass, obj, res) do { \ #define WrapOCSPBasicRes(klass, obj, res) do { \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_BASICRESP_free, res); \ (obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
} while (0) } while (0)
#define GetOCSPBasicRes(obj, res) do { \ #define GetOCSPBasicRes(obj, res) do { \
Data_Get_Struct(obj, OCSP_BASICRESP, res); \ Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0) } while (0)
#define SafeGetOCSPBasicRes(obj, res) do { \ #define SafeGetOCSPBasicRes(obj, res) do { \
OSSL_Check_Kind(obj, cOCSPBasicRes); \ OSSL_Check_Kind((obj), cOCSPBasicRes); \
GetOCSPBasicRes(obj, res); \ GetOCSPBasicRes((obj), (res)); \
} while (0) } while (0)
#define WrapOCSPCertId(klass, obj, cid) do { \ #define WrapOCSPCertId(klass, obj, cid) do { \
if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_CERTID_free, cid); \ (obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \
} while (0) } while (0)
#define GetOCSPCertId(obj, cid) do { \ #define GetOCSPCertId(obj, cid) do { \
Data_Get_Struct(obj, OCSP_CERTID, cid); \ Data_Get_Struct((obj), OCSP_CERTID, (cid)); \
if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0) } while (0)
#define SafeGetOCSPCertId(obj, cid) do { \ #define SafeGetOCSPCertId(obj, cid) do { \
OSSL_Check_Kind(obj, cOCSPCertId); \ OSSL_Check_Kind((obj), cOCSPCertId); \
GetOCSPCertId(obj, cid); \ GetOCSPCertId((obj), (cid)); \
} while (0) } while (0)
VALUE mOCSP; VALUE mOCSP;