[libvirt PATCH v5 1/9] internal: Add CONCAT macro

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

 



Using the two-step idiom to force resolution of other macros, e.g.:

  #define bar BAR
  CONCAT_(foo, bar)     // foobar
  CONCAT(foo, bar)      // fooBAR

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/internal.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/internal.h b/src/internal.h
index b6e4332542..4cfb022b41 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -100,6 +100,9 @@
 #define STREQ_NULLABLE(a, b) (g_strcmp0(a, b) == 0)
 #define STRNEQ_NULLABLE(a, b) (g_strcmp0(a, b) != 0)
 
+#define CONCAT_(a, b) a ## b
+#define CONCAT(a, b) CONCAT_(a, b)
+
 #ifdef WIN32
 # ifndef O_CLOEXEC
 #  define O_CLOEXEC _O_NOINHERIT
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux