diff --git a/src/feature.h b/src/feature.h
index 0383cdb8422e7fa9214606358562dcca4adc7fb4..3173901b2721596ad857277b59eeea6fa744ada2 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -382,7 +382,7 @@
 /*
  * +profile		Profiling for functions and scripts.
  */
-#ifdef FEAT_HUGE
+#if defined(FEAT_HUGE) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
 # define FEAT_PROFILE
 #endif