lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


To get around the floating point issue, the linux kernel codes the version in hex and provides a macro for comparisons:

    #define LINUX_VERSION_CODE 132376
    #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

For example:

    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
    ....
    #endif

Using conditional code is lousy, but it should be for the users to decide.

-John


--
http:// i      .   /