avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "深蓝" <nar...@qq.com>
Subject Report a bug!!
Date Sun, 25 Sep 2011 14:27:43 GMT
when i review the avro's code. I find:
..............
#define avro_record_get_field_value(rc, rec, typ, fname, ...)	\
	do {							\
		avro_datum_t  field = NULL;			\
		(rc) = avro_record_get((rec), (fname), &field);	\
		if (rc) break;					\
		(rc) = avro_##typ##_get(field, __VA_ARGS__);	\
	} while (0)

.............


I think, if the typ == enum that like this:
(rc) = avro_##typ##_get(field, __VA_ARGS__);  // avro_enum_get(field,);


To help solve this problem, CPP behaves specially for variable arguments used with the token
paste operator, `##'. If instead you write
(rc) = avro_##typ##_get(field, ##__VA_ARGS__);


and if the variable arguments are omitted or empty, the `##' operator causes the preprocessor
to remove the comma before it.


the same to avro_record_set_field_value.

I like avro! Come on! Keep it up!
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message