diff --git a/src/ice_socket.h b/src/ice_socket.h
index 57b83c73f67561d70bbe770f53ffe3663a24ebcc..2e474f2c1270fd03cc20ad8f3445888209aeb78f 100644
--- a/src/ice_socket.h
+++ b/src/ice_socket.h
@@ -23,6 +23,11 @@
 #include <memory>
 #include <functional>
 
+#if defined(_MSC_VER)
+#include <BaseTsd.h>
+using ssize_t = SSIZE_T;
+#endif
+
 namespace ring {
 
 class IceTransport;
diff --git a/src/utf8_utils.cpp b/src/utf8_utils.cpp
index b9bba48b912426e3bc24d7d08d77ac20de0e97c8..6fe23ab2c5e8a21cac07087e5e8b76121507459c 100644
--- a/src/utf8_utils.cpp
+++ b/src/utf8_utils.cpp
@@ -25,6 +25,11 @@
 #include <cassert>
 #include "utf8_utils.h"
 
+#if defined(_MSC_VER)
+#include <BaseTsd.h>
+using ssize_t = SSIZE_T;
+#endif
+
 /*
  * The LIKELY and UNLIKELY macros let the programmer give hints to
  * the compiler about the expected result of an expression. Some compilers