Browse code

core: don't use conditionals in macro arguments

Older gccs (< 3.3) do not like #ifdefs inside macro calls.

Andrei Pelinescu-Onciul authored on 26/08/2010 19:46:19
Showing 2 changed files
... ...
@@ -812,12 +812,14 @@ inline static int io_watch_chg(io_wait_h* h, int fd, short events, int idx )
812 812
 	del_events=e->events & ~events;
813 813
 	switch(h->poll_method){
814 814
 		case POLL_POLL:
815
-			fd_array_chg(events
816 815
 #ifdef POLLRDHUP
816
+			fd_array_chg(events |
817 817
 							/* listen to POLLRDHUP by default (if POLLIN) */
818
-							| (((int)!(events & POLLIN) - 1) & POLLRDHUP)
819
-#endif /* POLLRDHUP */
818
+							(((int)!(events & POLLIN) - 1) & POLLRDHUP)
820 819
 						);
820
+#else /* POLLRDHUP */
821
+			fd_array_chg(events);
822
+#endif /* POLLRDHUP */
821 823
 			break;
822 824
 #ifdef HAVE_SELECT
823 825
 		case POLL_SELECT:
... ...
@@ -2475,12 +2475,17 @@ int sctp_rcv_loop()
2475 2475
 		
2476 2476
 		/* get ancillary data */
2477 2477
 		for (cmsg=CMSG_FIRSTHDR(&msg); cmsg; cmsg=CMSG_NXTHDR(&msg, cmsg)){
2478
+#ifdef SCTP_EXT
2478 2479
 			if (likely((cmsg->cmsg_level==IPPROTO_SCTP) &&
2479 2480
 						((cmsg->cmsg_type==SCTP_SNDRCV)
2480
-#ifdef SCTP_EXT
2481 2481
 						 || (cmsg->cmsg_type==SCTP_EXTRCV)
2482
-#endif
2483
-						) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) ){
2482
+						) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) )
2483
+#else  /* !SCTP_EXT -- same as above but w/o SCTP_EXTRCV */
2484
+			if (likely((cmsg->cmsg_level==IPPROTO_SCTP) &&
2485
+						((cmsg->cmsg_type==SCTP_SNDRCV)
2486
+						) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) )
2487
+#endif /*SCTP_EXT */
2488
+			{
2484 2489
 				sinfo=(struct sctp_sndrcvinfo*)CMSG_DATA(cmsg);
2485 2490
 				DBG("sctp recv: message from %s:%d stream %d  ppid %x"
2486 2491
 						" flags %x%s tsn %u" " cumtsn %u assoc_id %d\n",