diff --git a/src/flac/decode.c b/src/flac/decode.c
index 3a6997b..4dad37e 100644
--- a/src/flac/decode.c
+++ b/src/flac/decode.c
@@ -25,6 +25,7 @@
 #include <math.h> /* for floor() */
 #include <stdio.h> /* for FILE etc. */
 #include <string.h> /* for strcmp(), strerror() */
+#define FLAC__COMPAT_USE_WINAPI /* for CreateFile_utf8 */
 #include "FLAC/all.h"
 #include "share/grabbag.h"
 #include "share/replaygain_synthesis.h"
diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c
index 73f7fca..fb784b9 100644
--- a/src/share/grabbag/file.c
+++ b/src/share/grabbag/file.c
@@ -46,6 +46,7 @@
 #include <windows.h>
 #include <winbase.h>
 #endif
+#define FLAC__COMPAT_USE_WINAPI /* for CreateFile_utf8 */
 #include "share/grabbag.h"
 
 
