diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 37f64b5d08..a1baa7729e 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -40,9 +40,8 @@

 #ifdef USE_WIN32API
 #include <ws2tcpip.h>
-#ifndef ETIMEDOUT
+#undef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
-#endif
 /* Gnulib defines close too, but gnulib's replacement
    doesn't call closesocket unless we import the
    socketlib module.  */
