diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in index 1754cca0eb8c..149e82dbe43f 100644 --- a/lib/libarchive/archive.h.in +++ b/lib/libarchive/archive.h.in @@ -29,6 +29,16 @@ #ifndef ARCHIVE_H_INCLUDED #define ARCHIVE_H_INCLUDED + +#include /* Linux requires this for off_t */ +#include /* For int64_t */ +#include /* For ssize_t and size_t */ + +#ifdef __cplusplus +extern "C" { +#endif + + /* * If ARCHIVE_API_VERSION != archive_api_version(), then the library you * were linked with is using an incompatible API. This is almost @@ -51,10 +61,6 @@ int archive_api_feature(void); /* Textual name/version of the library. */ const char * archive_version(void); -#include /* Linux requires this for off_t */ -#include /* For int64_t */ -#include /* For ssize_t and size_t */ - #define ARCHIVE_BYTES_PER_RECORD 512 #define ARCHIVE_DEFAULT_BYTES_PER_BLOCK 10240 @@ -318,4 +324,8 @@ const char *archive_format_name(struct archive *); int archive_format(struct archive *); void archive_set_error(struct archive *, int _err, const char *fmt, ...); +#ifdef __cplusplus +} +#endif + #endif /* !ARCHIVE_H_INCLUDED */ diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h index c4d494b57986..dec8b960d8b4 100644 --- a/lib/libarchive/archive_entry.h +++ b/lib/libarchive/archive_entry.h @@ -32,6 +32,12 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + + /* * Description of an archive entry. * @@ -215,4 +221,9 @@ int archive_entry_acl_count(struct archive_entry *, int want_type); int __archive_entry_acl_parse_w(struct archive_entry *, const wchar_t *, int type); + +#ifdef __cplusplus +} +#endif + #endif /* !ARCHIVE_ENTRY_H_INCLUDED */