diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-06-14 16:46:34 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-06-14 16:47:23 -0700 |
commit | 2468c9488c65003ef30f3b50f1f0104720e41c18 (patch) | |
tree | 4c0452f3d055330d5b9e59ee974da01db49e7837 | |
parent | f44eb378f7239eadac38d02463019a8a6b935525 (diff) | |
download | gnulib-2468c9488c65003ef30f3b50f1f0104720e41c18.tar.gz |
idx: new printf/scanf length modifier macro
* lib/idx.h (pIDX): New macro.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/idx.h | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2021-06-14 Paul Eggert <eggert@cs.ucla.edu> + + idx: new printf/scanf length modifier macro + * lib/idx.h (pIDX): New macro. + 2021-06-13 Bruno Haible <bruno@clisp.org> Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11). @@ -107,6 +107,10 @@ typedef ptrdiff_t idx_t; /* IDX_MAX is the maximum value of an idx_t. */ #define IDX_MAX PTRDIFF_MAX +/* A printf/scanf length modifier for idx_t. For example, if i is an idx_t, + printf ("i = %"pIDX"d\n", i) outputs i's value. */ +#define pIDX "t" + /* So far no need has been found for an IDX_WIDTH macro. Perhaps there should be another macro IDX_VALUE_BITS that does not count the sign bit and is therefore one less than PTRDIFF_WIDTH. */ |