Changeset 3823

Show
Ignore:
Timestamp:
07/24/08 04:05:54 (6 months ago)
Author:
proski
Message:

Copy new macros from the DFS branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/trunk/include/compat.h

    r3771 r3823  
    9191#define howmany(x, y)   (((x)+((y)-1))/(y)) 
    9292 
     93/* roundup() and howmany() macros that works both with positive and negative 
     94 * values. */ 
     95#define roundup_s(x,y) _roundup_s((signed)(x),(signed)(y)) 
     96#define howmany_s(x,y) _howmany_s((signed)(x),(signed)(y)) 
     97#define _roundup_s(x,y) \ 
     98        ((x) >= 0 ? (((x)+((y)-1))/(y))*(y) : ((x)/(y))*(y)) 
     99#define _howmany_s(x, y)        \ 
     100        ((x) >= 0 ? (((x)+((y)-1))/(y)) : ((x)/(y))) 
     101 
    93102/* Bit map related macros. */ 
    94103#define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))