diff --git a/upgrade/bindata.S b/upgrade/bindata.S
index 1d94da50..585a670d 100644
--- a/upgrade/bindata.S
+++ b/upgrade/bindata.S
@@ -24,5 +24,5 @@ _bindata:
.incbin "../src/blackmagic.bin"
_bindatalen:
- .word . - _bindata
+ .long (. - _bindata)
diff --git a/upgrade/dfu.c b/upgrade/dfu.c
index 2ab16ed0..598780ab 100644
--- a/upgrade/dfu.c
+++ b/upgrade/dfu.c
@@ -18,7 +18,11 @@
* along with this program. If not, see .
*/
-#include
+#ifdef WIN32
+# include
+#else
+# include
+#endif
#include "dfu.h"
diff --git a/upgrade/main.c b/upgrade/main.c
index dd92a2ec..f029545c 100644
--- a/upgrade/main.c
+++ b/upgrade/main.c
@@ -18,8 +18,12 @@
* along with this program. If not, see .
*/
#include
-#include
#include
+#ifdef WIN32
+# include
+#else
+# include
+#endif
#include
diff --git a/upgrade/stm32mem.c b/upgrade/stm32mem.c
index 4731edc9..53bbb5b9 100644
--- a/upgrade/stm32mem.c
+++ b/upgrade/stm32mem.c
@@ -17,13 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include
#include
#ifdef WIN32
# include
+# include
#else
# include
+# include
#endif
#include "dfu.h"
diff --git a/upgrade/stm32mem.h b/upgrade/stm32mem.h
index 34cdfb16..fd99c656 100644
--- a/upgrade/stm32mem.h
+++ b/upgrade/stm32mem.h
@@ -20,7 +20,11 @@
#ifndef __STM32MEM_H
#define __STM32MEM_H
-#include
+#ifdef WIN32
+# include
+#else
+# include
+#endif
int stm32_mem_erase(usb_dev_handle *dev, uint16_t iface, uint32_t addr);
int stm32_mem_write(usb_dev_handle *dev, uint16_t iface, void *data, int size);