From: Hemant Date: Wed, 18 Jun 2025 19:05:23 +0000 (-0500) Subject: Error related to restrict keyword supressed for older vs compiler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2687%2Fhead;p=thirdparty%2Flibarchive.git Error related to restrict keyword supressed for older vs compiler --- diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 8ef8676d7..782d36d6f 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -17,7 +17,9 @@ #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 restrict /* The restrict keyword is not supported. */ +#define ARCHIVE_RESTRICT +#else +#define ARCHIVE_RESTRICT restrict #endif struct creation_set; @@ -192,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);