December 17, 2017, 06:01:56 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: What exactly compiler.h does?  (Read 2060 times)

Offline jeeva

  • Linux Noob !
  • *
  • Posts: 28
What exactly compiler.h does?
« on: October 03, 2004, 07:16:55 AM »
#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif
#define likely(x)       __builtin_expect((x),1)
#define unlikely(x)     __builtin_expect((x),0)
#endif /* __LINUX_COMPILER_H */

Can anyone tell me, what exactly the above code does?

like if i say for eg:

struct usb_device temp;

if( likely( temp ) )
       printk( "\nCondition: TRUE\n" );
else
       printk( "\nCondition: FALSE\n" );

What will be the out put and why?

Thank you,
Regards,
Jeeva