C macros with operator explanation
<p>I'm wondering how operator passing into macros works. They are macros from glib sources (<code>glib/testutils.h</code>).</p>

<p>In code you are using assert as <code>g_assert_cmpint(1, ==, 2);</code>, so operator just passed as is. How it works? What does <code>#</code> token mean in this macro?</p>

<pre><code>#define g_assert_cmpint(n1, cmp, n2)                  \
  G_STMT_START {                                      \
    gint64 __n1 = (n1), __n2 = (n2);                  \
    if (__n1 cmp __n2) ;                              \
    else                                              \
      g_assertion_message_cmpnum(                     \
        G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC,  \
        #n1 " " #cmp " " #n2, __n1, #cmp, __n2, 'i'); \
  } G_STMT_END
</code></pre>

<p>and <code>g_assert_message_cmpnum</code> has such interface:</p>

<pre><code>void g_assertion_message_cmpnum(const char *domain, \
                                 const char *file,\
                                 int line,\
                                 const char func,\
                                 const char *expr,\
                                 long double arg1, \
                                 const char *cmp,\
                                 long double arg2,\
                                 char numtype);
</code></pre>

<p>does this mean that <code>#</code> converts <code>cmp</code> operator to a string? </p>

<p>But then how to understand this line <code>#n1 " " #cmp " " #n2</code> from a macro?</p>