bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new modules for libunistring metadata


From: Bruno Haible
Subject: Re: new modules for libunistring metadata
Date: Wed, 21 Feb 2024 03:10:27 +0100

Collin Funk wrote:
> Would it make sense to provide a macro to check if the current version
> is greater than or equal to a given version? Or should that just be left
> up to whoever wants to use this variable.

Why is there no macro
  #define streq(a,b) (strcmp (a, b) == 0)
in <string.h>? Because it can be left to the user.

Nevertheless, sometimes you see
  #define is_empty(list) (size_of (list) == 0)
It could be left to the user, but is included in the API because
the size of the list and the concept of an empty list are
distinct concepts (although related and very close).

> I was thinking something like this:
> 
> #define LIBUNISTRING_UNICODE_VERSION_P(major, minor) \
>   (_libunistring_unicode_version >= ((major << 8) + minor))

For my feeling, there's too little added value in such a macro.

Remember the costs of documenting a function or macro:
  - The user needs more time to read the documentation.
  - The developer needs to code and document it.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]