--- compat.h
+++ compat.h
@@ -198,7 +198,9 @@
 
 #ifndef HAVE_B64_NTOP
 /* b64_ntop.c */
-int		 b64_ntop(const char *, size_t, char *, size_t);
+int		 tmux_b64_ntop(const char *, size_t, char *, size_t);
+#else
+#define tmux_b64_ntop b64_ntop
 #endif
 
 #ifndef HAVE_FORKPTY
--- compat/b64_ntop.c
+++ compat/b64_ntop.c
@@ -122,7 +122,7 @@
    */
 
 int
-b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
+tmux_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
 	size_t datalength = 0;
 	uint8_t input[3];
 	uint8_t output[4];
--- tty.c
+++ tty.c
@@ -1034,7 +1034,7 @@
 	off = 4 * ((ctx->num + 2) / 3) + 1; /* storage for base64 */
 	buf = xmalloc(off);
 
-	b64_ntop(ctx->ptr, ctx->num, buf, off);
+	tmux_b64_ntop(ctx->ptr, ctx->num, buf, off);
 	tty_putcode_ptr2(tty, TTYC_MS, "", buf);
 
 	free(buf);
