From: Hans U. N. <gp...@n-...> - 2005-03-11 15:57:16
|
"Jan Patera" <pa...@pi...> writes: >> The Ubuntu thing seems to have spawned a flurry of activity in other >> areas. Is that stable, or should I create a branch with the Ubuntu fix, >> but without all the other changes? > > Absolutely stable. No need for any branching. There are no undergoing > changes that would need any stabilization. Good, then let's find out how to do the stdint.h stuff, and then release 0.6.12. >>> May I ask you (or somebody else) to update the configure scripts to >>> generate also the definition of int16_t (signed 16 bit) in _stdint.h? >>> Thanks. >> >> You'll have to help me there: >> >> - What should int16_t be defined as? > > signed 16 bit integer (usually called short). As far as I can tell, our generated _stdint.h either includes definitions for all uint{8,16,32}_t and int{8,16,32}_t by including the proper system file defining them or none at all. >> - Or where is int16_t defined on your system? > Nowhere. What system is that? OS/Compiler/make/...? > exif-utils.h was already using uint16_t, uint32_t > and int32_t. I just added int16_t for consistency (to typedef > ExifSShort). Good idea. > I am not a *nix developer, therefore I am not much familiar with > the (auto)configuration process. However, upto my understanding, all > these types are defined in _stdint.h which is automatically generated > by the configure script. Explanation of our current _stdint.h generation: According to C99, your C runtime should define those types in stdint.h. However, if your system isn't C99 compatible, we try to fall back on a number of non-standard (Unix) header files like inttypes.h. Our current way to generate _stdint.h is a simplified version of AC_CREATE_STDINT_H[1] from http://ac-archive.sourceforge.net/ written by Dan Fandrich for libgphoto2. libgphoto2 is still a Unix centric library, so we don't really have to deal with non-Unix systems there. libexif is a different case, though, because a number of people use it on non-Unix systems. Finding a solution: It makes sense for libexif to ship a exif-stdint.h which adds the "proper" integer definitions for your system if you don't have one of the "standard" header files providing them. Ideally, we would be able to ship a static exif-stdint.h file which doesn't have to be modified by and configuration script and figures out what to do purely using preprocessor magic. Unfortunately, this is not possible, so we have to generate that exif-stdint.h file at ./configure time using AC_CREATE_STDINT_H[1] (yes, that seems to work with cross-compilation). This raises the question of whether your system actually supports running ./configure: - Linux/BSD/Unix/MacOSX have the proper environment anyway - Windows has mingw - OS/2 afaik has a way to install bash&co, too. - other systems? no idea. This still leaves open whether the results of such a configure run are suitable to use with other compilers like Watcom or MSVC. For systems not capable of running ./configure, we can only ship a few example files and documentation telling people what to do with them (like the stuff in contrib/watcom). My Proposal: Use the full AC_CREATE_STDINT_H[1] for libexif and create a exif-stdint.h which is installed when installing libexif headers. Also ship exif-stdint.h for a number of common special cases, together with a README.stdint explaining the problem. Those common special cases would probably be=20 - 8/16/32 bit integers as char/short/int - 8/16/32 bit integers as char/int/long using "unsigned foo" and "signed foo" for the (un)signed versions. Would that be OK for you, Jan? > My manually edited _stdint.h contains this: > #ifndef __STDINT_H > #define __STDINT_H > > typedef unsigned char uint8_t; > typedef unsigned short uint16_t; > typedef signed short int16_t; > typedef unsigned int uint32_t; > typedef signed int int32_t; > > #endif /*!__STDINT_H*/ This is a fairly common way to define these types, and contrib/watcom/_stdint.h basically contains this now. I took the liberty to also add a signed int8_t for completeness' sake. [1] http://ac-archive.sourceforge.net/C_Support/ac_create_stdint_h.html Gru=C3=9F, Uli |