diff options
author | Werner Koch <[email protected]> | 2013-04-25 11:00:16 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-05-16 15:48:50 +0000 |
commit | 6d0d8e7ba0bb989c251545fa8af35b97d1a703ba (patch) | |
tree | 9350cede809e12536956f6487c92d3f2d9489d66 /doc/gpgme.texi | |
parent | w32: Change the way the I/O threads are cleaned up. (diff) | |
download | gpgme-6d0d8e7ba0bb989c251545fa8af35b97d1a703ba.tar.gz gpgme-6d0d8e7ba0bb989c251545fa8af35b97d1a703ba.zip |
Make definition of off_t robust against misbehaving w32 toolchains.
* configure.ac (NEED__FILE_OFFSET_BITS): Change to define gpgme_off_t
and gpgme_ssize_t.
(API__OFF_T, API__SSIZE_T): New ac_subst.
* src/gpgme.h.in: Replace all ssize_t and off_t by ac_subst macros.
* src/assuan-support.c, src/ath-pthread.c, src/ath.c, src/ath.h
* src/data-compat.c, src/data-fd.c, src/data-mem.c, src/data-stream.c
* src/data-user.c, src/data.c, src/data.h, src/engine-gpgsm.c
* src/engine-uiserver.c, src/gpgme-tool.c, src/gpgme.c: Replace off_t
by gpgme_off_t and sszie_t by gpgme_ssize_t.
* src/ath-pthread.c, src/ath.h: Include gpgme.h.
--
For a detailed description, see the gpgme.texi diff.
Diffstat (limited to 'doc/gpgme.texi')
-rw-r--r-- | doc/gpgme.texi | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi index b47d4383..589747d0 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -493,18 +493,42 @@ support by default and just use that. The compatibility modes (small file sizes or dual mode) can be considered an historic artefact, only useful to allow for a transitional period. -@acronym{GPGME} is compiled using largefile support by default. This -means that your application must do the same, at least as far as it is -relevant for using the @file{gpgme.h} header file. All types in this -header files refer to their largefile counterparts, if they are -different from any default types on the system. - -You can enable largefile support, if it is different from the default -on the system the application is compiled on, by using the Autoconf -macro @code{AC_SYS_LARGEFILE}. If you do this, then you don't need to -worry about anything else: It will just work. In this case you might -also want to use @code{AC_FUNC_FSEEKO} to take advantage of some new -interfaces, and @code{AC_TYPE_OFF_T} (just in case). +On POSIX platforms @acronym{GPGME} is compiled using largefile support +by default. This means that your application must do the same, at +least as far as it is relevant for using the @file{gpgme.h} header +file. All types in this header files refer to their largefile +counterparts, if they are different from any default types on the +system. + +On 32 and 64 bit Windows platforms @code{off_t} is declared as 32 bit +signed integer. There is no specific support for LFS in the C +library. The recommendation from Microsoft is to use the native +interface (@code{CreateFile} et al.) for large files. Released binary +versions of @acronym{GPGME} (libgpgme-11.dll) have always been build +with a 32 bit @code{off_t}. To avoid an ABI break we stick to this +convention for 32 bit Windows by using @code{long} there. +@acronym{GPGME} versions for 64 bit Windows have never been released +and thus we are able to use @code{int64_t} instead of @code{off_t} +there. For easier migration the typedef @code{gpgme_off_t} has been +defined. The reason we cannot use @code{off_t} directly is that some +toolchains (e.g. mingw64) introduce a POSIX compatible hack for +@code{off_t}. Some widely used toolkits make use of this hack and in +turn @acronym{GPGME} would need to use it also. However, this would +introduce an ABI break and existing software making use of libgpgme +might suffer from a severe break. Thus with version 1.4.2 we +redefined all functions using @code{off_t} to use @code{gpgme_off_t} +which is defined as explained above. This way we keep the ABI well +defined and independent of any toolchain hacks. The bottom line is +that LFS support in @acronym{GPGME} is only available on 64 bit +versions of Windows. + +On POSIX platforms you can enable largefile support, if it is +different from the default on the system the application is compiled +on, by using the Autoconf macro @code{AC_SYS_LARGEFILE}. If you do +this, then you don't need to worry about anything else: It will just +work. In this case you might also want to use @code{AC_FUNC_FSEEKO} +to take advantage of some new interfaces, and @code{AC_TYPE_OFF_T} +(just in case). If you do not use Autoconf, you can define the preprocessor symbol @code{_FILE_OFFSET_BITS} to 64 @emph{before} including any header @@ -1538,6 +1562,20 @@ by using memory buffers or files rather than pipes or sockets. This might be relevant, for example, if the external event loop mechanism is used. +@deftp {Data type} {gpgme_off_t} +On POSIX platforms the @code{gpgme_off_t} type is an alias for +@code{off_t}; it may be used interchangeable. On Windows platforms +@code{gpgme_off_t} is defined as a long (i.e. 32 bit) for 32 bit +Windows and as a 64 bit signed integer for 64 bit Windows. +@end deftp + +@deftp {Data type} {gpgme_ssize_t} +The @code{gpgme_ssize_t} type is an alias for @code{ssize_t}. It has +only been introduced to overcome portability problems pertaining to +the declaration of @code{ssize_t} by different toolchains. +@end deftp + + @menu * Creating Data Buffers:: Creating new data buffers. * Destroying Data Buffers:: Releasing data buffers. |