Skip to content

Commit 1076f1e

Browse files
newrengitster
authored andcommitted
Remove forward declaration of an enum
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 <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f790d81 commit 1076f1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packfile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifndef PACKFILE_H
22
#define PACKFILE_H
33

4+
#include "cache.h"
45
#include "oidset.h"
56

67
/* in object-store.h */
78
struct packed_git;
89
struct object_info;
9-
enum object_type;
1010

1111
/*
1212
* Generate the filename to be used for a pack file with checksum "sha1" and

0 commit comments

Comments
 (0)