From fe21ca5510377f67322b901d85d2649b7dff8d9b Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Wed, 16 May 2018 14:55:42 +0200 Subject: [PATCH] avrdude: Build fixes --- xs/src/avrdude/CMakeLists.txt | 1 + xs/src/avrdude/buspirate.c | 3 --- xs/src/avrdude/libavrdude.h | 7 +++++++ xs/src/avrdude/ser_posix.c | 2 -- xs/src/avrdude/stk500.c | 3 --- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xs/src/avrdude/CMakeLists.txt b/xs/src/avrdude/CMakeLists.txt index d7a0f2021..043f8fb7b 100644 --- a/xs/src/avrdude/CMakeLists.txt +++ b/xs/src/avrdude/CMakeLists.txt @@ -1,5 +1,6 @@ +add_definitions(-D_BSD_SOURCE -D_DEFAULT_SOURCE) # To enable various useful macros and functions on Unices remove_definitions(-D_UNICODE -DUNICODE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_C_STANDARD 99) diff --git a/xs/src/avrdude/buspirate.c b/xs/src/avrdude/buspirate.c index a06019b9c..435c4ce53 100644 --- a/xs/src/avrdude/buspirate.c +++ b/xs/src/avrdude/buspirate.c @@ -41,9 +41,6 @@ #include #include #include -#if defined(WIN32NATIVE) -# include /* for alloca() */ -#endif #include "avrdude.h" #include "libavrdude.h" diff --git a/xs/src/avrdude/libavrdude.h b/xs/src/avrdude/libavrdude.h index 786b4d961..42c413ed7 100644 --- a/xs/src/avrdude/libavrdude.h +++ b/xs/src/avrdude/libavrdude.h @@ -933,6 +933,13 @@ int read_config(const char * file); } #endif +// Header file for alloca() +#if defined(WIN32NATIVE) +# include +#else +# include +#endif + /* formerly confwin.h */ diff --git a/xs/src/avrdude/ser_posix.c b/xs/src/avrdude/ser_posix.c index e71c40179..81e05da2e 100644 --- a/xs/src/avrdude/ser_posix.c +++ b/xs/src/avrdude/ser_posix.c @@ -25,8 +25,6 @@ #if !defined(WIN32NATIVE) -#define _BSD_SOURCE // Needed to enable various macros (such as h_addr) - #include #include #include diff --git a/xs/src/avrdude/stk500.c b/xs/src/avrdude/stk500.c index 987589305..5d2d3c1df 100644 --- a/xs/src/avrdude/stk500.c +++ b/xs/src/avrdude/stk500.c @@ -35,9 +35,6 @@ #include #include #include -#if defined(WIN32NATIVE) -# include /* for alloca() */ -#endif #include "avrdude.h" #include "libavrdude.h"