Copy new macros from the DFS branch

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3823 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2008-07-24 02:05:54 +00:00
parent 9fb3122e7a
commit 8d74405839

View File

@ -90,6 +90,15 @@
#define howmany(x, y) (((x)+((y)-1))/(y))
/* roundup() and howmany() macros that works both with positive and negative
* values. */
#define roundup_s(x,y) _roundup_s((signed)(x),(signed)(y))
#define howmany_s(x,y) _howmany_s((signed)(x),(signed)(y))
#define _roundup_s(x,y) \
((x) >= 0 ? (((x)+((y)-1))/(y))*(y) : ((x)/(y))*(y))
#define _howmany_s(x, y) \
((x) >= 0 ? (((x)+((y)-1))/(y)) : ((x)/(y)))
/* Bit map related macros. */
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))