From 47317fbef87a3a6ac581a48ff5d017cbf980f676 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Thu, 16 Jun 2016 08:50:06 +0200
Subject: [PATCH] Fix in __PLUMED_DEFAULT_KERNEL

In this manner quotes are not required in -D
making its syntax simpler
---
 src/wrapper/Plumed.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/wrapper/Plumed.c b/src/wrapper/Plumed.c
index c1da0f052..285946827 100644
--- a/src/wrapper/Plumed.c
+++ b/src/wrapper/Plumed.c
@@ -127,12 +127,15 @@ plumed_plumedmain_function_holder* plumed_kernel_register(const plumed_plumedmai
 #ifdef __PLUMED_DEFAULT_KERNEL
 /*
   This variable allows a default path for the kernel to be hardcoded.
-  Can be usedful for hardcoding the predefined plumed location
+  Can be useful for hardcoding the predefined plumed location
   still allowing the user to override this choice setting PLUMED_KERNEL.
   The path should be chosen at compile time adding e.g.
-  -D__PLUMED_DEFAULT_KERNEL=\"/opt/local/lib/libplumed.dylib\"
+  -D__PLUMED_DEFAULT_KERNEL=/opt/local/lib/libplumed.dylib
 */
-    if(! (path && (*path) )) path=__PLUMED_DEFAULT_KERNEL;
+/* This is required to add quotes */
+#define PLUMED_QUOTE_DIRECT(name) #name
+#define PLUMED_QUOTE(macro) PLUMED_QUOTE_DIRECT(macro)
+    if(! (path && (*path) )) path=PLUMED_QUOTE(__PLUMED_DEFAULT_KERNEL);
 #endif
     if(path && (*path)){
       fprintf(stderr,"+++ Loading the PLUMED kernel runtime +++\n");
-- 
GitLab