Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Kernel 2.6.24 - missing function LONG

Help
2008-03-17
2013-04-15
  • loungelircer
    loungelircer
    2008-03-17

    Hi Florian,

    It seems that the LONG macro has been removed from input.h in kernel 2.6.24
    This was preventing lirc_mod_mce from compiling on my system. I've tracked down the original definition and added the following to the start of your lirc_mod_mce.c:

    #ifndef LONG
            #define LONG(x) ((x)/BITS_PER_LONG)
    #endif

    ..and lirc_mod_mce compiles again!

    Just thought I'd post this here as I'm guessing there will be other people with this problem soon enough.

    Regards,

    Ben Caldwell

     
    • Florian Demski
      Florian Demski
      2008-03-17

      Hi Ben,

      I just included it in my experimental Pinnacle patch. I think that it will find it's way into the sources.

      Thanks,

      Florian

       
    • Sami Laitinen
      Sami Laitinen
      2008-03-18

      Hi,

      I ran across this same problem few days ago. I compared the source code to a few other lirc modules and made this patch. I don't know if it's the right way to address this issue, since I don't have much experience with C...

      --- lirc_mod_mce.old/lirc_mod_mce.c 2007-04-17 12:30:01.000000000 +0300
      +++ lirc_mod_mce/lirc_mod_mce.c 2008-03-14 13:45:04.000000000 +0200
      @@ -1112,14 +1112,14 @@
          input_dev->phys = ir->phys;
          usb_to_input_id(dev, &input_dev->id);
          input_dev->cdev.dev = &dev->dev;
      -       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
      -       input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
      +       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
      +       input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
          for (i=0; i<256; i++) {
              set_bit(usb_kbd_keycode[i], input_dev->keybit);
          }

           clear_bit(0, input_dev->keybit);
      -       input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
      +       input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT);

          input_register_device(input_dev);