Add ptrdiff_t (pointer difference) printf length modifier

Some of existing code prints pointer differences, but without taking into
account that printf length modifier required for this differs between
systems.
Add SC_FORMAT_LEN_PTRDIFF_T macro for this, just as we have for size_t
variables.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
This commit is contained in:
Maciej S. Szmigiero 2016-08-23 18:42:12 +02:00 committed by Frank Morgner
parent 1479c4cb3b
commit 5877fd260d
1 changed files with 3 additions and 1 deletions

View File

@ -46,9 +46,11 @@ extern "C" {
#if defined(_WIN32)
#define SC_FORMAT_LEN_SIZE_T "I"
#define SC_FORMAT_LEN_PTRDIFF_T "I"
#else
/* hope SUSv3 one works */
/* hope SUSv3 ones work */
#define SC_FORMAT_LEN_SIZE_T "z"
#define SC_FORMAT_LEN_PTRDIFF_T "t"
#endif
#define SC_SEC_OPERATION_DECIPHER 0x0001