From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <79dc8d5b2d0f6aaa2d6b20dabe37be4b@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] what's wrong with this? From: Sape Mullender MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 27 Sep 2002 10:09:12 -0400 Topicbox-Message-UUID: f61d5460-eaca-11e9-9e20-41e7f4b1d025 > Dear friends, > > 8c complies "syntax error" when the following macro is called: > > #define jpc_bitstream_getbit_macro(bitstream) \ > (assert((bitstream)->openmode_ & JPC_BITSTREAM_READ), \ > (--(bitstream)->cnt_ >= 0) ? \ > (((bitstream)->buf_ >> (bitstream)->cnt_) & 1) : \ > jpc_bitstream_fillbuf(bitstream)) > > int ret; > ... > ret=jpc_bitstream_getbit_macro(bitstream); For starters, it's abhorrently awful code. You're also using macros recursively. Assert is a macro: #define assert(x) if(x){}else _assert("x") Substitute it in your code and behold the mess you get. What are you trying to save with this macro anyway? Sape