From 15f8d4f33e3ab69e93c1682582c11564f2ec96aa Mon Sep 17 00:00:00 2001 From: kientzle Date: Sat, 4 Jun 2005 22:24:04 +0000 Subject: Support libarchive with C++ by adding appropriate conditional extern "C" declarations. --- lib/libarchive/archive.h.in | 18 ++++++++++++++---- lib/libarchive/archive_entry.h | 11 +++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in index 1754cca..149e82d 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 c4d494b..dec8b96 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 */ -- cgit v1.1