Remove forward declaration of an enum
authorElijah Newren <newren@gmail.com>
Wed, 15 Aug 2018 17:54:10 +0000 (10:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Aug 2018 18:52:09 +0000 (11:52 -0700)
According to http://c-faq.com/null/machexamp.html, sizeof(char*) !=
sizeof(int*) on some platforms. Since an enum could be a char or int
(or long or...), knowing the size of the enum thus is important to
knowing the size of a pointer to an enum, so we cannot just forward
declare an enum the way we can a struct. (Also, modern C++ compilers
apparently define forward declarations of an enum to either be useless
because the enum was defined, or require an explicit size specifier, or
be a compilation error.)

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.h
index cc7eaffe1baef8accc1476c92145b7c4bcdcf046..fa36c473adaf02df7395329587baf07e47febb34 100644 (file)
@@ -1,12 +1,12 @@
 #ifndef PACKFILE_H
 #define PACKFILE_H
 
+#include "cache.h"
 #include "oidset.h"
 
 /* in object-store.h */
 struct packed_git;
 struct object_info;
-enum object_type;
 
 /*
  * Generate the filename to be used for a pack file with checksum "sha1" and