Mailing List archive

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

[vdr] Re: [linux-dvb] Re: Problems switching to dvb-kernel under2.6



befor I begin, I should mention that I have neither an idea about what 
msleep does nor what other helper functions were used before, so my 
suggestion is quite general and so might or might not be of help.


On Sat, 4 Sep 2004, C.Y.M. (C) wrote:

C> Something like if kernel > 2.6.5 then use msleep, and if it is below
C> 2.6.5, use the previous helper function.

if it is just that, then you could do something like defining a macro
depending on the kernel version and always use that macro, like this:

   #include <stdio.h>


   #ifdef FOO
        #define BAR(x) bla(x)
   #else
        #define BAR(x) blubber(x)
   #endif


   void bla( char x ) {
        printf("bla: %c\n", x);
   }

   void blubber( char x ) {
        printf("blubber: %c\n", x);
   }

   int main(int argc, char **argv) {

        BAR('a');
 
        return 0;
   }

C> But, this does sound like a maintenance nightmare :(.

of course one would have to go over the source once, (something like
s/.../.../ should do it, though) but the maintainance would be kept at
minimum after that.

or you even go and if the kernel version is <= 2.6.5, you define an msleep 
using the old helper functions and you're done.


        Sergei
-- 
--------------------------------------------------------------------  -?)
         eMail:       Sergei.Haller@math.uni-giessen.de               /\\
-------------------------------------------------------------------- _\_V
Be careful of reading health books, you might die of a misprint.
                -- Mark Twain




Home | Main Index | Thread Index