diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog
index 30b0789a..199a0637 100644
--- a/avrdude/ChangeLog
+++ b/avrdude/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-08  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	* bitbang.c: Fix Win32 build error: move freq up to the file
+	level.
+	* buspirate.c: Fix Win32 build warning: include <malloc.h> to
+	to get a declaration for alloca().
+
 2010-01-08  Thomas Fischl <tfischl@gmx.de>
 
 	bug #28520: Programming with USBasp with low clock speed fails
diff --git a/avrdude/bitbang.c b/avrdude/bitbang.c
index c7ba89b1..24b85183 100644
--- a/avrdude/bitbang.c
+++ b/avrdude/bitbang.c
@@ -44,6 +44,7 @@ static int delay_decrement;
 
 #if defined(WIN32NATIVE)
 static int has_perfcount;
+static LARGE_INTEGER freq;
 #else
 static volatile int done;
 
@@ -63,8 +64,6 @@ static void alarmhandler(int signo)
 static void bitbang_calibrate_delay(void)
 {
 #if defined(WIN32NATIVE)
-  static LARGE_INTEGER freq;
-
   /*
    * If the hardware supports a high-resolution performance counter,
    * we ultimately prefer that one, as it gives quite accurate delays
diff --git a/avrdude/buspirate.c b/avrdude/buspirate.c
index 443efec5..ea1b6c2e 100644
--- a/avrdude/buspirate.c
+++ b/avrdude/buspirate.c
@@ -41,6 +41,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if defined(WIN32NATIVE)
+#  include <malloc.h>  /* for alloca() */
+#endif
 
 #include "avrdude.h"
 #include "avr.h"