--- a/tclhfs.c
+++ b/tclhfs.c
@@ -43,8 +43,7 @@
 # include "charset.h"
 # include "suid.h"
 # include "version.h"
-
-extern int errno;
+# include <errno.h>
 
 # define ERROR(code, str)	(hfs_error = (str), errno = (code))
 
