chiark / gitweb /
Change version number to 4.0.
[disorder] / lib / macros.c
index f177ae0e10f9749a12966bcceb841d4ad6edc47f..7b7714423ac02c6a45544d74453b7b255c6d16ff 100644 (file)
  * @brief Macro expansion
  */
 
-#include <config.h>
-#include "types.h"
+#include "common.h"
 
-#include <string.h>
 #include <ctype.h>
-#include <assert.h>
-#include <stdio.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -350,9 +346,7 @@ static int mx__register(unsigned flags,
   e->args = args;
   e->callback = callback;
   e->definition = definition;
-  return hash_add(expansions, name, &e,
-                  ((flags & EXP_TYPE_MASK) == EXP_MACRO)
-                      ? HASH_INSERT : HASH_INSERT_OR_REPLACE);
+  return hash_add(expansions, name, &e, HASH_INSERT_OR_REPLACE);
 }
 
 /** @brief Register a simple expansion rule
@@ -394,11 +388,13 @@ int mx_register_macro(const char *name,
                       const struct mx_node *definition) {
   if(mx__register(EXP_MACRO, name, nargs, nargs, args,  0/*callback*/,
                   definition)) {
+#if 0
     /* This locates the error to the definition, which may be a line or two
      * beyond the @define command itself.  The backtrace generated by
      * mx_expand() may help more. */
     error(0, "%s:%d: duplicate definition of '%s'",
           definition->filename, definition->line, name);
+#endif
     return -2;
   }
   return 0;