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-16 15:55:42 +0300
committerVojtech Kral <vojtech@kral.hk>2018-05-21 19:58:22 +0300
commitfe21ca5510377f67322b901d85d2649b7dff8d9b (patch)
tree50f23d437df73732bf3d6343e5c61dc45230f843 /xs/src/avrdude
parent404fdbcfdf52ffd91db09549c26bf6aa2377e974 (diff)
avrdude: Build fixes
Diffstat (limited to 'xs/src/avrdude')
-rw-r--r--xs/src/avrdude/CMakeLists.txt1
-rw-r--r--xs/src/avrdude/buspirate.c3
-rw-r--r--xs/src/avrdude/libavrdude.h7
-rw-r--r--xs/src/avrdude/ser_posix.c2
-rw-r--r--xs/src/avrdude/stk500.c3
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 <stdlib.h>
#include <string.h>
#include <unistd.h>
-#if defined(WIN32NATIVE)
-# include <malloc.h> /* 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 <malloc.h>
+#else
+# include <alloca.h>
+#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 <ctype.h>
#include <stdio.h>
#include <stdlib.h>
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 <string.h>
#include <errno.h>
#include <unistd.h>
-#if defined(WIN32NATIVE)
-# include <malloc.h> /* for alloca() */
-#endif
#include "avrdude.h"
#include "libavrdude.h"