diff --git a/src/avisynth.h b/src/avisynth.h
index 7e15f2133663035bb7d8c1ba5991039d1d1289c7..fa3fd1cdc7640638b647324f069ddd996f2bb4b4 100644
--- a/src/avisynth.h
+++ b/src/avisynth.h
@@ -81,6 +81,8 @@ typedef	long			PixOffset;
   #define _RPT4(a,b,c,d,e,f) ((void)0)
 
   #define _ASSERTE(x) assert(x)
+  // not sure why it's used but not defined, so...
+  #define _ASSERT(x) assert(x)
   #include <assert.h>
 #endif
 
diff --git a/src/meson.build b/src/meson.build
index 1238f6dea3bcb59c9f19ed3d7558e6959d2f5a63..7db5092dd98287fb6181316722a7bd2c3ba93e24 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -211,6 +211,15 @@ foreach opt: opt_src
     endif
 endforeach
 
+# avisynth for windows build
+if host_machine.system() == 'windows'
+    aegisub_src += [
+        'audio_provider_avs.cpp',
+        'video_provider_avs.cpp',
+    ]
+endif
+    
+
 aegisub_cpp_pch = ['include/agi_pre.h']
 aegisub_c_pch = ['include/agi_pre_c.h']