From 664a20b6c7c47225af338a2bd6aa2f6fb11d5bc7 Mon Sep 17 00:00:00 2001 From: Hemant Date: Wed, 18 Jun 2025 14:05:23 -0500 Subject: [PATCH] Error related to restrict keyword supressed for older vs compiler --- tar/bsdtar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.47.2