--- a/libmx5000/mx5000.c
+++ b/libmx5000/mx5000.c
@@ -29,6 +29,7 @@
 
 #include <asm/types.h>
 #include <linux/hiddev.h>
+#include <linux/limits.h>
 
 #include "libmx5000/mx5000.h"
 
--- a/libmx5000/hidraw_lib.c
+++ b/libmx5000/hidraw_lib.c
@@ -8,6 +8,7 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <linux/limits.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
