summary refs log tree commit diff stats
path: root/subprojects/libvhost-user/libvhost-user.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2022-12-22 21:36:41 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-01-11 10:44:34 +0100
commitaa5d395ac4351d85472fa3d4266b26b8025f9356 (patch)
tree444410b75fdacf0419b31c758479cf16995ed7fb /subprojects/libvhost-user/libvhost-user.c
parentdadc3d01bcb0d8654361e5ce77f65a679f2d7a80 (diff)
downloadfocaccia-qemu-aa5d395ac4351d85472fa3d4266b26b8025f9356.tar.gz
focaccia-qemu-aa5d395ac4351d85472fa3d4266b26b8025f9356.zip
libvhost-user: Replace typeof with __typeof__
Strictly speaking only -std=gnu99 support the usage of typeof and for
easier inclusion in external projects, it is better to use __typeof__.

  CC       libvhost-user.o
libvhost-user.c: In function ‘vu_log_queue_fill’:
libvhost-user.c:86:13: error: implicit declaration of function ‘typeof’ [-Werror=implicit-function-declaration]
   86 |             typeof(x) _min1 = (x);              \
      |             ^~~~~~

Changing these two users of typeof makes the compiler happy and no extra
flags or pragmas need to be provided.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <981aa822bcaaa2b8d74f245339a99a85c25b346f.1671741278.git.marcel@holtmann.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'subprojects/libvhost-user/libvhost-user.c')
-rw-r--r--subprojects/libvhost-user/libvhost-user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index b55b9e244d..67d75ece53 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -62,8 +62,8 @@
 #endif  /* !__GNUC__ */
 #ifndef MIN
 #define MIN(x, y) ({                            \
-            typeof(x) _min1 = (x);              \
-            typeof(y) _min2 = (y);              \
+            __typeof__(x) _min1 = (x);          \
+            __typeof__(y) _min2 = (y);          \
             (void) (&_min1 == &_min2);          \
             _min1 < _min2 ? _min1 : _min2; })
 #endif