]> git.notmuchmail.org Git - notmuch/commitdiff
lib: fix definition of LIBNOTMUCH_CHECK_VERSION
authorDavid Bremner <david@tethera.net>
Tue, 7 Jun 2016 10:37:57 +0000 (07:37 -0300)
committerDavid Bremner <david@tethera.net>
Thu, 30 Jun 2016 15:49:29 +0000 (17:49 +0200)
Fix bug reported in id:20160606124522.g2y2eazhhrwjsa4h@flatcap.org

Although the C99 standard 6.10 is a little non-obvious on this point,
the docs for e.g. gcc are unambiguous. And indeed in practice with the
extra space, this code fails

#include <stdio.h>
#define foo (x) (x+1)

int main(int argc, char **argv){
  printf("%d\n",foo(1));
}

lib/notmuch.h

index a43e167c2f84a059d31ff0fa093fd2de2abb9908..24944f0b84f201e9b811aff6f419aeca1e6e53bd 100644 (file)
@@ -93,7 +93,7 @@ NOTMUCH_BEGIN_DECLS
  * #endif
  * @endcode
  */
-#define LIBNOTMUCH_CHECK_VERSION (major, minor, micro)                 \
+#define LIBNOTMUCH_CHECK_VERSION(major, minor, micro)                  \
     (LIBNOTMUCH_MAJOR_VERSION > (major) ||                                     \
      (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION > (minor)) || \
      (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION == (minor) && \