Re: [AD] Problems with keyboard |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
David A. Capello wrote:
Done!, I found the error, the problem is that Sarge installed a new
version of linux-kernel-headers (2.5.999-test7-bk-16), where
<linux/keyboard.h> includes <linux/input.h>, and in this last file
there are definitions like:
Good job.
One solution is definining _INPUT_H after <linux/keyboard.h>:
#define _INPUT_H
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <linux/vt.h>
Dirty.
Other solution is moving these includes to the top of the file, so
Allegro will overwrite the original Linux definitions. But there are
another thing: You know that gcc doesn't like redefinitions, but gcc
doesn't warn me about that <linux/input.h> redefines Allegro KEY_*
macros, but the inverse isn't true, gcc warn me when Allegro redefines
<linux/input.h> macros. How linux headers can disable the warning?
(some #pragma)
Yes, strange.
How about this solution?
enum {
__allegro_KEY_A=1,
...
};
#define KEY_A __al_KEY_A
Then in lkeybd.c we can refer to __allegro_KEY_A instead of KEY_A. I'm
doing something like this in the new_api_branch already, except that the
prefix AL_KEY_ is used. We could use AL_KEY_ in 4.0.x and 4.2.x as
well, but I'd rather not get the new API and the old API mixed up.
Peter