From: matthieu c. <cas...@fr...> - 2004-03-19 17:49:49
|
Jan Patera wrote: >Joerg, > >unless you equip libexif with definitions of uint16_t, uint32_t >and int32_t, this "simple" change will break compilability for many >platforms. E.g. MSVC does not know such types (is it in some latest C++ >standard?). > > --- Jan > > > >>On Thu, Mar 18, 2004 at 03:45:52PM +0100, Hans Ulrich Niedermann wrote: >> >> >>>Definitely. For formats of a fixed size, one should always use >>>u?int(8|16|32)_t. If required, ship a _stdint.h and do some automake >>>and #ifdef magic. >>> >>> >>I've looked into exif-utils.h and did small changes to: >> >>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; >> >> >>Now, all problems should disappear. Only some printf-Statements, which >>need format modifier for eg ExifLong, are throwing warnings. Are there >>any specifier for uint32_t which can be used with printf and friends? >> >>Joerg >> >> > > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >Libexif-devel mailing list >Lib...@li... >https://lists.sourceforge.net/lists/listinfo/libexif-devel > > > > you could add something like that for those broken compilers (from ffmpeg libavcodec/common.h) #ifndef EMULATE_INTTYPES # include <inttypes.h> #else typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; # ifdef CONFIG_WIN32 typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; # else /* other OS */ typedef signed long long int64_t; typedef unsigned long long uint64_t; # endif /* other OS */ #endif /* HAVE_INTTYPES_H */ |