diff --git a/getopt_long.h b/getopt_long.h
index 7bd35fd..6001341 100644
--- a/getopt_long.h
+++ b/getopt_long.h
@@ -54,7 +54,7 @@ struct pkg_option {
 	 */
 	int has_arg;
 	/* if not NULL, set *flag to val when option found */
-	int *flag;
+	uint64_t *flag;
 	/* if flag not NULL, value to set *flag to; else return value */
 	int val;
 };
diff --git a/main.c b/main.c
index 0d81851..6e2ce2a 100644
--- a/main.c
+++ b/main.c
@@ -49,7 +49,7 @@
 
 static unsigned int global_traverse_flags = PKGF_NONE;
 
-static int want_flags;
+static uint64_t want_flags;
 static int maximum_traverse_depth = 2000;
 
 static char *want_variable = NULL;
diff --git a/stdinc.h b/stdinc.h
index e44f190..c892ebd 100644
--- a/stdinc.h
+++ b/stdinc.h
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <stdint.h>
 
 #ifdef _WIN32
 # define WIN32_LEAN_AND_MEAN