From: Tim Kientzle Date: Sun, 29 Jun 2025 02:04:30 +0000 (-0700) Subject: Merge pull request #2687 from hemant-jadhav-emerson/master X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cab1650fd3b3461d9374acbcb852b0114c1ebd8;p=thirdparty%2Flibarchive.git Merge pull request #2687 from hemant-jadhav-emerson/master Supress restrict keyword for msc_ver older than 1927 (cherry picked from commit ee49ac81068f93754f004368f2cc72c95a8bf056) --- diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 45dfeed7d..782d36d6f 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -16,6 +16,12 @@ #define ENV_WRITER_OPTIONS "TAR_WRITER_OPTIONS" #define IGNORE_WRONG_MODULE_NAME "__ignore_wrong_module_name__," +#if defined(_MSC_VER ) && (_MSC_VER < 1927 ) /* Check if compiler pre-dated Visual Studio 2019 Release 16.8 */ +#define ARCHIVE_RESTRICT +#else +#define ARCHIVE_RESTRICT restrict +#endif + struct creation_set; /* * The internal state for the "bsdtar" program. @@ -188,7 +194,7 @@ int edit_pathname(struct bsdtar *, struct archive_entry *); void edit_mtime(struct bsdtar *, struct archive_entry *); int need_report(void); int pathcmp(const char *a, const char *b); -void safe_fprintf(FILE * restrict, const char * restrict fmt, ...) __LA_PRINTF(2, 3); +void safe_fprintf(FILE * ARCHIVE_RESTRICT, const char * ARCHIVE_RESTRICT fmt, ...) __LA_PRINTF(2, 3); void set_chdir(struct bsdtar *, const char *newdir); const char *tar_i64toa(int64_t); void tar_mode_c(struct bsdtar *bsdtar);