summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/buffer.c1
-rw-r--r--src/config.h.in6
3 files changed, 9 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 87651bc..bb0c7c1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -117,6 +117,7 @@ install(FILES cmark.h ${CMAKE_CURRENT_BINARY_DIR}/cmark_export.h
# Feature tests
include(CheckIncludeFile)
include(CheckCSourceCompiles)
+include(CheckSymbolExists)
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
CHECK_C_SOURCE_COMPILES(
"int main() { __builtin_expect(0,0); return 0; }"
@@ -125,6 +126,7 @@ CHECK_C_SOURCE_COMPILES("
int f(void) __attribute__ (());
int main() { return 0; }
" HAVE___ATTRIBUTE__)
+CHECK_SYMBOL_EXISTS(va_copy stdarg.h HAVE_VA_COPY)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
diff --git a/src/buffer.c b/src/buffer.c
index 15a6d05..87d817b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "config.h"
#include "cmark_ctype.h"
#include "buffer.h"
diff --git a/src/config.h.in b/src/config.h.in
index 5294bc9..c1e9597 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -15,3 +15,9 @@
#else
#define CMARK_ATTRIBUTE(list)
#endif
+
+#cmakedefine HAVE_VA_COPY
+
+#ifndef HAVE_VA_COPY
+ #define va_copy(dest, src) ((dest) = (src))
+#endif