Include "config.h" in header files using off_t

This makes it absolutely dead easy to ensure off_t has the same length
in all compilation units. I just spent 2.5 hours bashing my head on an
issue related to this so damn it I'm fixing it for good.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-04-15 18:40:32 -05:00
parent 4ffda3f05b
commit 202ade1398
3 changed files with 8 additions and 2 deletions

View file

@ -20,6 +20,8 @@
#ifndef _ALPM_DELTA_H #ifndef _ALPM_DELTA_H
#define _ALPM_DELTA_H #define _ALPM_DELTA_H
#include "config.h" /* ensure off_t is correct length */
#include <sys/types.h> /* off_t */ #include <sys/types.h> /* off_t */
#include "alpm.h" #include "alpm.h"
@ -29,12 +31,12 @@ struct __pmdelta_t {
char *delta; char *delta;
/** md5sum of the delta file */ /** md5sum of the delta file */
char *delta_md5; char *delta_md5;
/** filesize of the delta file */
off_t delta_size;
/** filename of the 'before' file */ /** filename of the 'before' file */
char *from; char *from;
/** filename of the 'after' file */ /** filename of the 'after' file */
char *to; char *to;
/** filesize of the delta file */
off_t delta_size;
/** download filesize of the delta file */ /** download filesize of the delta file */
off_t download_size; off_t download_size;
}; };

View file

@ -19,6 +19,8 @@
#ifndef _ALPM_GRAPH_H #ifndef _ALPM_GRAPH_H
#define _ALPM_GRAPH_H #define _ALPM_GRAPH_H
#include "config.h" /* ensure off_t is correct length */
#include <sys/types.h> /* off_t */ #include <sys/types.h> /* off_t */
#include "alpm_list.h" #include "alpm_list.h"

View file

@ -24,6 +24,8 @@
#ifndef _ALPM_PACKAGE_H #ifndef _ALPM_PACKAGE_H
#define _ALPM_PACKAGE_H #define _ALPM_PACKAGE_H
#include "config.h" /* ensure off_t is correct length */
#include <sys/types.h> /* off_t */ #include <sys/types.h> /* off_t */
#include <time.h> /* time_t */ #include <time.h> /* time_t */