摘要:
今天在看《Unix 环境高级编程》时对信号集的操作(P254),这个在对寄存器或者标志位做位操作时很有借鉴意义。 #BIT_WIDTH 32 #define BITBAD( bit ) ( (bit)<=0 || (bit) >= BIT_WIDTH ) // set one bit in the flag bit_set( long flag, int bit ) { if( BITBAD(bit) ) oops(" bit is not correct"," "); *flag |= 1<<( bit - 1 ); } //d 阅读全文