Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a pipe in a macro signify?

Tags:

c++

How is the following macro definition resolved?

#define EMAIL_SERVER_ADAPTER_FATAL_ERROR     MSB_RETURN_TYPE_FATAL_ERROR | 1

I mean, is it resolved to 1 or to MSB_RETURN_TYPE_FATAL_ERROR and why?

like image 251
akshay Avatar asked Dec 01 '25 11:12

akshay


1 Answers

| has no special meaning in macros. The macro is resolved to

MSB_RETURN_TYPE_FATAL_ERROR | 1

which is bitwise OR of two values (MSB_RETURN_TYPE_FATAL_ERROR and 1).

like image 114
nullptr Avatar answered Dec 03 '25 03:12

nullptr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!