Skip to content

Commit 129740c

Browse files
committed
Temporary fix to pass R CMD check on Windows
See issue #227 Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>
1 parent 60d8df9 commit 129740c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/libgit2/src/config.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,14 @@ int git_config_delete_entry(git_config *cfg, const char *name)
599599
int git_config_set_int64(git_config *cfg, const char *name, int64_t value)
600600
{
601601
char str_value[32]; /* All numbers should fit in here */
602+
#ifdef _WIN32
603+
#pragma GCC diagnostic push
604+
#pragma GCC diagnostic ignored "-Wformat-extra-args"
602605
p_snprintf(str_value, sizeof(str_value), "%" PRId64, value);
606+
#pragma GCC diagnostic pop
607+
#else
608+
p_snprintf(str_value, sizeof(str_value), "%" PRId64, value);
609+
#endif
603610
return git_config_set_string(cfg, name, str_value);
604611
}
605612

src/libgit2/src/odb.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
5353
int git_odb__format_object_header(char *hdr, size_t n, git_off_t obj_len, git_otype obj_type)
5454
{
5555
const char *type_str = git_object_type2string(obj_type);
56+
#ifdef _WIN32
57+
#pragma GCC diagnostic push
58+
#pragma GCC diagnostic ignored "-Wformat-extra-args"
5659
int len = p_snprintf(hdr, n, "%s %lld", type_str, (long long)obj_len);
60+
#pragma GCC diagnostic pop
61+
#else
62+
int len = p_snprintf(hdr, n, "%s %lld", type_str, (long long)obj_len);
63+
#endif
5764
assert(len > 0 && len <= (int)n);
5865
return len+1;
5966
}

0 commit comments

Comments
 (0)