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

* ext/openssl/ossl.h: parenthesize macro arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-02-17 12:33:07 +00:00
parent 36a0a1a3f3
commit 5206119844
2 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,7 @@
Thu Feb 17 21:32:53 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl.h: parenthesize macro arguments.
Wed Feb 16 20:37:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* eval_jump.c (rb_exec_end_proc): changed at_exit and END proc

View file

@ -84,21 +84,21 @@ extern VALUE eOSSLError;
* CheckTypes
*/
#define OSSL_Check_Kind(obj, klass) do {\
if (!rb_obj_is_kind_of(obj, klass)) {\
if (!rb_obj_is_kind_of((obj), (klass))) {\
ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected kind of %s)",\
rb_obj_classname(obj), rb_class2name(klass));\
}\
} while (0)
#define OSSL_Check_Instance(obj, klass) do {\
if (!rb_obj_is_instance_of(obj, klass)) {\
if (!rb_obj_is_instance_of((obj), (klass))) {\
ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected instance of %s)",\
rb_obj_classname(obj), rb_class2name(klass));\
}\
} while (0)
#define OSSL_Check_Same_Class(obj1, obj2) do {\
if (!rb_obj_is_instance_of(obj1, rb_obj_class(obj2))) {\
if (!rb_obj_is_instance_of((obj1), rb_obj_class(obj2))) {\
ossl_raise(rb_eTypeError, "wrong argument type");\
}\
} while (0)
@ -129,7 +129,7 @@ do{\
int len = RSTRING_LEN(str);\
int newlen = (p) - (unsigned char*)RSTRING_PTR(str);\
assert(newlen <= len);\
rb_str_set_len(str, newlen);\
rb_str_set_len((str), newlen);\
}while(0)
/*
@ -180,13 +180,13 @@ extern VALUE dOSSL;
} while (0)
#define OSSL_Warning(fmt, ...) do { \
OSSL_Debug(fmt, ##__VA_ARGS__); \
rb_warning(fmt, ##__VA_ARGS__); \
OSSL_Debug((fmt), ##__VA_ARGS__); \
rb_warning((fmt), ##__VA_ARGS__); \
} while (0)
#define OSSL_Warn(fmt, ...) do { \
OSSL_Debug(fmt, ##__VA_ARGS__); \
rb_warn(fmt, ##__VA_ARGS__); \
OSSL_Debug((fmt), ##__VA_ARGS__); \
rb_warn((fmt), ##__VA_ARGS__); \
} while (0)
#else
void ossl_debug(const char *, ...);