-#define YY_INPUT(buffer, bytes_read, bytes_requested) \
- lexer_input((buffer), &(bytes_read), (bytes_requested))
+#define YY_INPUT(buffer, bytes_read, bytes_requested) \
+({ \
+ int __ret; \
+ unsigned int __bread = bytes_read; \
+ __ret = lexer_input((buffer), &__bread, (bytes_requested)); \
+ bytes_read = __bread; \
+ __ret; \
+})