diff options
Diffstat (limited to 'src/system.h')
-rw-r--r-- | src/system.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h index 423f0fa8b..3f6aed6d2 100644 --- a/src/system.h +++ b/src/system.h @@ -383,6 +383,14 @@ static inline unsigned char to_uchar (char ch) { return ch; } #define _(msgid) gettext (msgid) #define N_(msgid) msgid +/* Return a value that pluralizes the same way that N does, in all + languages we know of. */ +static inline unsigned long int +select_plural (uintmax_t n) +{ + return (n <= ULONG_MAX ? n : n % 1000 + 1000); +} + #define STREQ(a, b) (strcmp ((a), (b)) == 0) #if !HAVE_DECL_FREE |