summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htssafe.h14
-rw-r--r--src/httrack-library.h8
2 files changed, 21 insertions, 1 deletions
diff --git a/src/htssafe.h b/src/htssafe.h
index 329d12a..d0d6c2a 100644
--- a/src/htssafe.h
+++ b/src/htssafe.h
@@ -33,6 +33,14 @@ Please visit our Website: http://www.httrack.com
#ifndef HTSSAFE_DEFH
#define HTSSAFE_DEFH
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "htsglobal.h"
/**
@@ -91,7 +99,7 @@ static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
/**
* Check wether 'VAR' is of type char[].
*/
-#ifdef __GNUC__
+#if (defined(__GNUC__) && !defined(__cplusplus))
/* Note: char[] and const char[] are compatible */
#define HTS_IS_CHAR_BUFFER(VAR) ( __builtin_types_compatible_p ( typeof (VAR), char[] ) )
#else
@@ -199,4 +207,8 @@ static HTS_INLINE HTS_UNUSED char* strcpy_safe_(char *const dest, const size_t s
#define realloct(A,B) realloc(A, B)
#define memcpybuff(A, B, N) memcpy((A), (B), (N))
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/httrack-library.h b/src/httrack-library.h
index 2638401..622fe07 100644
--- a/src/httrack-library.h
+++ b/src/httrack-library.h
@@ -33,6 +33,10 @@ Please visit our Website: http://www.httrack.com
#ifndef HTTRACK_DEFLIB
#define HTTRACK_DEFLIB
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "htsglobal.h"
#ifndef _WIN32
@@ -332,4 +336,8 @@ typedef struct utimbuf STRUCT_UTIMBUF;
#define fconcat(A,B,C,D) (COMPILE_TIME_CHECK_SIZE(B), fconcat(A,B,C,D))
#define fslash(A,B,C) (COMPILE_TIME_CHECK_SIZE(B), fslash(A,B,C))
+#ifdef __cplusplus
+}
+#endif
+
#endif