diff --git a/unix/modtermios.c b/unix/modtermios.c
index a70edf5bf45f711f42433b7014740ca62ac8ab9d..94074e1d0050a0a4d6db71e70aa92b1b55f66240 100644
--- a/unix/modtermios.c
+++ b/unix/modtermios.c
@@ -136,8 +136,12 @@ STATIC const mp_rom_map_elem_t mp_module_termios_globals_table[] = {
     C(TCSANOW),
 
     C(B9600),
+    #ifdef B57600
     C(B57600),
+    #endif
+    #ifdef B115200
     C(B115200),
+    #endif
 #undef C
 };