PollArrayWrapper.c

Andrew Haley aph at redhat.com
Wed Mar 2 15:51:41 UTC 2016


On 03/02/2016 03:20 PM, kirk.pepperdine at gmail.com wrote:
> Is there a reason why this logic is wrapped in a do { …. } while(0)

Every multi-statement #define must always be wrapped in do { …. } while(0)

consider

   if (blah)
      MACRO;
   else
      stuff;

The { } mean the right thing happens with multiple statments;
the while 0 eats the trailing semicolon in

  MACRO;

Andrew.



More information about the hotspot-dev mailing list