]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Error related to restrict keyword supressed for older vs compiler 2687/head
authorHemant <hemant.jadhav@emerson.com>
Wed, 18 Jun 2025 19:05:23 +0000 (14:05 -0500)
committerHemant <hemant.jadhav@emerson.com>
Wed, 18 Jun 2025 19:05:23 +0000 (14:05 -0500)
tar/bsdtar.h

index 8ef8676d7ef8fbb01d159ba85e95c39ed26b4d08..782d36d6f75620f1bf1ae2f725417d9e48093aaf 100644 (file)
@@ -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);