Changeset 1691

Show
Ignore:
Timestamp:
07/22/06 01:10:36 (2 years ago)
Author:
proski
Message:

Check if roundup() is actually defined

There are still 2.6.18-rc1 kernels around, which don't have roundup().
Generally, it's better to test for features than for versions. Some
code gets backported by vendors.

Files:

Legend:

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

    r1689 r1691  
    4444#define NBBY    8                       /* number of bits/byte */ 
    4545 
    46 #include <linux/version.h> 
    47 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) 
     46/* roundup() appears in Linux 2.6.18 */ 
     47#ifndef roundup 
    4848#define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))  /* to any y */  
    4949#endif