diff --git a/src/proto.h b/src/proto.h
index 77aca662340526d83a937ca80c9d88a143198cf0..33ae447f7e7eef31557fe183f52aced6825d88f6 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -524,7 +524,7 @@ void do_gotolinecolumn_void(void);
 void do_gotopos(int line, size_t pos_x, int pos_y, size_t pos_pww);
 #endif
 void do_find_bracket(void);
-#ifndef NANO_SMALL
+#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
 bool history_has_changed(void);
 void history_init(void);
 filestruct *find_history(filestruct *h, const char *s);
diff --git a/src/search.c b/src/search.c
index ce78a225007c270c1a639a99ee1b140f37ee4fc5..2ae9c3859bba08921e601ff8de030152644ba703 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1119,7 +1119,7 @@ void do_find_bracket(void)
 }
 #endif
 
-#ifndef NANO_SMALL
+#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
 /* Indicate whether any of the history lists have changed. */
 bool history_has_changed(void)
 {
@@ -1239,4 +1239,4 @@ char *get_history_newer(filestruct **h)
 
     return (*h)->data;
 }
-#endif /* !NANO_SMALL */
+#endif /* !NANO_SMALL && ENABLE_NANORC */