Mark the variable declarations in .h files as extern

This allows git to be built even with linkers which are not smart enough
to join those symbols, and makes this correct C. Pointed out by several
people.
This commit is contained in:
Petr Baudis 2005-05-11 00:58:16 +02:00 коммит произвёл Petr Baudis
Родитель 92747a907c
Коммит 883550481f
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -96,8 +96,8 @@ static inline unsigned int create_ce_mode(unsigned int mode)
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7) #define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
struct cache_entry **active_cache; extern struct cache_entry **active_cache;
unsigned int active_nr, active_alloc, active_cache_changed; extern unsigned int active_nr, active_alloc, active_cache_changed;
#define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY" #define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY"
#define DEFAULT_DB_ENVIRONMENT ".git/objects" #define DEFAULT_DB_ENVIRONMENT ".git/objects"

Просмотреть файл

@ -15,8 +15,8 @@ struct object {
struct object_list *refs; struct object_list *refs;
}; };
int nr_objs; extern int nr_objs;
struct object **objs; extern struct object **objs;
struct object *lookup_object(unsigned char *sha1); struct object *lookup_object(unsigned char *sha1);