#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 */
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);