Extra parenthesis around *_VERSION definitions
There are extra parenthesis around the *_VERSION
definitions: https://gitlab.gnome.org/GNOME/libsoup/-/blob/master/libsoup/soup-version.h.in#L14-16
The file version.h.in
was created 10 years ago, and it had the extra parenthesis already at the time: 33cf3c6f
The extra parenthesis become visible when one wants to display the version string with eg. G_STRINGIFY
.
Here's the code:
$ cat main.c
// gcc main.c $(pkg-config --cflags --libs glib-2.0 libsoup-3.0)
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include <libsoup/soup.h>
#define glib_details "glib " \
G_STRINGIFY (GLIB_MAJOR_VERSION) "." \
G_STRINGIFY (GLIB_MINOR_VERSION) "." \
G_STRINGIFY (GLIB_MICRO_VERSION)
#define soup_details "libsoup " \
G_STRINGIFY (SOUP_MAJOR_VERSION) "." \
G_STRINGIFY (SOUP_MINOR_VERSION) "." \
G_STRINGIFY (SOUP_MICRO_VERSION)
int main (int argc, char* argv[]) {
printf ("%s\n", glib_details);
printf ("%s\n", soup_details);
return EXIT_SUCCESS;
}
Here's the result:
$ ./a.out
glib 2.74.6
libsoup (3).(2).(2)
I know, it's just cosmetics, but is it possible to remove those parenthesis? It seems that they're useless. BUT I'm not familiar enough with C macros to be 100% sure. Thanks!