mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-10 00:49:09 +08:00
avrdude: Use C99, fix alloca include in stk500
This commit is contained in:
parent
af360d7097
commit
4ac17daad2
@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
remove_definitions(-D_UNICODE -DUNICODE)
|
remove_definitions(-D_UNICODE -DUNICODE)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
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
|
set(AVRDUDE_SOURCES
|
||||||
@ -64,6 +71,7 @@ if (WIN32)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
add_library(avrdude STATIC ${AVRDUDE_SOURCES})
|
add_library(avrdude STATIC ${AVRDUDE_SOURCES})
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_compile_definitions(avrdude PRIVATE WIN32NATIVE=1)
|
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
|
target_include_directories(avrdude SYSTEM PRIVATE ${LIBDIR}/avrdude/windows) # So that sources find the getopt.h windows drop-in
|
||||||
|
@ -35,7 +35,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <malloc.h>
|
#if defined(WIN32NATIVE)
|
||||||
|
# include <malloc.h> /* for alloca() */
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "avrdude.h"
|
#include "avrdude.h"
|
||||||
#include "libavrdude.h"
|
#include "libavrdude.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user