packfile: ensure that enum object_type is defined

When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with "make DEVELOPER=1 DEVOPTS=pedantic", the compiler says error: redeclaration of already-defined enum 'object_type' is a GNU extension [-Werror,-Wgnu-redeclared-enum] According to https://en.cppreference.com/w/c/language/declarations (section "Redeclaration"), a repeated declaration after the definition is only legal for structs and unions, but not for enums. Drop the belated declaration of enum object_type and include cache.h instead to make sure the enum is defined. Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Beat Bolli <dev+git@drbeat.li> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Beat Bolli committed Jul 25, 2018 at 23:56 UTC b42f98af096bfdf90339def75fe969b9d969b0f6
1 file changed +1 -1
packfile.h
+1 -1
@@ -1,12 +1,12 @@
1 #ifndef PACKFILE_H
2 #define PACKFILE_H
3
4 +#include "cache.h"
5 #include "oidset.h"
6
7 /* in object-store.h */
8 struct packed_git;
9 struct object_info;
9 -enum object_type;
10
11 /*
12 * Generate the filename to be used for a pack file with checksum "sha1" and