X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e95538ca2c8fdecd66a112635aa30077419af685..5b5f7e3b59ec2e2b45a35edf337cbed7fcd94f30:/rsync.h diff --git a/rsync.h b/rsync.h index 0327f2de..013ba700 100644 --- a/rsync.h +++ b/rsync.h @@ -181,13 +181,6 @@ enum msgcode { #if HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif #if HAVE_UNISTD_H # include #endif @@ -317,30 +310,43 @@ enum msgcode { #define schar char #endif +/* Find a variable that is either exactly 32-bits or longer. + * If some code depends on 32-bit truncation, it will need to + * take special action in a "#if SIZEOF_INT32 > 4" section. */ #ifndef int32 -#if (SIZEOF_INT == 4) -#define int32 int -#elif (SIZEOF_LONG == 4) -#define int32 long -#elif (SIZEOF_SHORT == 4) -#define int32 short +#if SIZEOF_INT == 4 +# define int32 int +# define SIZEOF_INT32 4 +#elif SIZEOF_LONG == 4 +# define int32 long +# define SIZEOF_INT32 4 +#elif SIZEOF_SHORT == 4 +# define int32 short +# define SIZEOF_INT32 4 +#elif SIZEOF_INT > 4 +# define int32 int +# define SIZEOF_INT32 SIZEOF_INT +#elif SIZEOF_LONG > 4 +# define int32 long +# define SIZEOF_INT32 SIZEOF_LONG #else -/* I hope this works */ -#define int32 int -#define LARGE_INT32 +# error Could not find a 32-bit integer variable #endif +#else +# define SIZEOF_INT32 4 #endif #ifndef uint32 #define uint32 unsigned int32 #endif -#if SIZEOF_OFF64_T -#define OFF_T off64_t -#define STRUCT_STAT struct stat64 -#else +#if SIZEOF_OFF_T == 8 || !SIZEOF_OFF64_T || !HAVE_STRUCT_STAT64 #define OFF_T off_t #define STRUCT_STAT struct stat +#else +#define OFF_T off64_t +#define STRUCT_STAT struct stat64 +#define USE_STAT64_FUNCS 1 #endif /* CAVEAT: on some systems, int64 will really be a 32-bit integer IFF