Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-05-15 17:16:09 +0300
committerVojtech Kral <vojtech@kral.hk>2018-05-21 19:58:22 +0300
commit4ac17daad22b3212a543ca98d2323fe75b28bf6d (patch)
treeee72c905c019996b89b9d0d24d51fd8c175ca853 /xs/src/avrdude
parentaf360d7097d3c946b712fc62f0af4592d0e8921f (diff)
avrdude: Use C99, fix alloca include in stk500
Diffstat (limited to 'xs/src/avrdude')
-rw-r--r--xs/src/avrdude/CMakeLists.txt8
-rw-r--r--xs/src/avrdude/stk500.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/xs/src/avrdude/CMakeLists.txt b/xs/src/avrdude/CMakeLists.txt
index b971452ee..d7a0f2021 100644
--- a/xs/src/avrdude/CMakeLists.txt
+++ b/xs/src/avrdude/CMakeLists.txt
@@ -2,6 +2,13 @@
remove_definitions(-D_UNICODE -DUNICODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ # Workaround for an old CMake, which does not understand CMAKE_C_STANDARD.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall")
+endif()
set(AVRDUDE_SOURCES
@@ -64,6 +71,7 @@ if (WIN32)
)
endif()
add_library(avrdude STATIC ${AVRDUDE_SOURCES})
+
if (WIN32)
target_compile_definitions(avrdude PRIVATE WIN32NATIVE=1)
target_include_directories(avrdude SYSTEM PRIVATE ${LIBDIR}/avrdude/windows) # So that sources find the getopt.h windows drop-in
diff --git a/xs/src/avrdude/stk500.c b/xs/src/avrdude/stk500.c
index 24052940b..987589305 100644
--- a/xs/src/avrdude/stk500.c
+++ b/xs/src/avrdude/stk500.c
@@ -35,7 +35,9 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <malloc.h>
+#if defined(WIN32NATIVE)
+# include <malloc.h> /* for alloca() */
+#endif
#include "avrdude.h"
#include "libavrdude.h"