abooij / haskell-xkbcommon

Haskell bindings for libxkbcommon
MIT License
7 stars 6 forks source link

Header file location changed #6

Closed cocreature closed 7 years ago

cocreature commented 8 years ago

It looks like in one of the latest linux releases (I think it is this commit) the key codes are now in linux/input-event-codes.h. I guess the proper solution to this would be to first check for this new header and fall back to the old one.

I am sadly busy during the next weeks so I don’t have time to make a PR.

abooij commented 8 years ago

Doesn't linux/input.h include this new file?

cocreature commented 8 years ago

Oh right, I missed that. However it looks the symtab returned by cpphs is missing the defines from that include. I’ll take a look when I get around to it.

cocreature commented 8 years ago

Alright, macroPassReturningSymTab just ignores #include. It is necessary to call cppIfdef beforehand to handle #include and #ifdef. It might make sense to disable warnings for that call to avoid errors for other includes that we are not interested in.

abooij commented 8 years ago

Okay but then we have to be a bit smarter because cppIfDef needs to be fed a search path, which we haven't computed. The purpose of the readHeader trick is exactly to avoid dealing with finding the right search path (instead using the cpp system tool to deal with that).

Suggestions are welcome.

cocreature commented 8 years ago

I tried it you can use an empty search path and it will search in the current directory which works for the linux headers. You get warnings for other headers but you could just turn off warnings.

cocreature commented 8 years ago

I think calling echo | cpp -Wp,-v will show you the include paths.

abooij commented 8 years ago

Can you confirm this is fixed by 20cd78a?

cocreature commented 7 years ago

I can, thanks for looking into this!