From: jb....@gmx.de: > I'm trying to do rounded (opposed to truncated) integer division with > avr-gcc with using only preprocessor magic. This proves to be difficult: > The current code I'm using is > > #define __IDIV(x, y) (long)(((long)x + ((long)y / 2L)) / (long)y) > #define IDIV(x, y) (__IDIV((x), (y))) I'm not sure why you're getting the error message, but the above seems unnecessarily complex. For what it's worth, the following should have equivalent functionality, and does not generate the error: #define IDIV(x,y) ( ((x)+(y)/2L)/(y) ) Regards, -=Dave _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/201469229/direct/01/
_______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list