From: J?rg H. <ho...@us...> - 2004-04-01 20:36:23
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1319 Modified Files: exif-utils.h Log Message: - use types of appropriate size if stdint.h is available Index: exif-utils.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-utils.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- exif-utils.h 6 Aug 2003 19:47:53 -0000 1.6 +++ exif-utils.h 1 Apr 2004 20:24:22 -0000 1.7 @@ -27,6 +27,21 @@ #include <libexif/exif-byte-order.h> +/* Works correct only on machines with a stdint.h, otherwise it assumes + * sizeof(long) == 4 */ + +#ifdef HAVE_INTTYPES_H +#include <stdint.h> +typedef char ExifByte; /* 1 byte */ +typedef char * ExifAscii; +typedef uint16_t ExifShort; /* 2 bytes */ +typedef uint32_t ExifLong; /* 4 bytes */ +typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational; +typedef char ExifUndefined; /* 1 byte */ +typedef int32_t ExifSLong; /* 4 bytes */ +typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational; + +#else typedef char ExifByte; /* 1 byte */ typedef char * ExifAscii; typedef unsigned short ExifShort; /* 2 bytes */ @@ -35,7 +50,7 @@ typedef char ExifUndefined; /* 1 byte */ typedef signed long ExifSLong; /* 4 bytes */ typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational; - +#endif ExifShort exif_get_short (const unsigned char *b, ExifByteOrder order); ExifLong exif_get_long (const unsigned char *b, ExifByteOrder order); |