diff --git a/aesopt.h b/aesopt.h
index 60675e418ffb3cb31fb968d407f2849103629d80..799c8a694d255027b4bdba5fde9ef79a7be16a9a 100755
--- a/aesopt.h
+++ b/aesopt.h
@@ -149,6 +149,7 @@
 /*  PLATFORM SPECIFIC INCLUDES */
 
 #if defined( __FreeBSD__ ) || defined( __OpenBSD__ )
+#  include <sys/types.h>
 #  include <sys/endian.h>
 #elif defined( BSD ) && ( BSD >= 199103 )
 #  include <machine/endian.h>