[augeas-devel] [Augeas] #110: Macro _N in fa.c already taken on Solaris

Augeas trac at fedorahosted.org
Mon Mar 1 16:01:27 UTC 2010


#110: Macro _N in fa.c already taken on Solaris
------------------------+---------------------------------------------------
 Reporter:  dmichelsen  |       Owner:  lutter
     Type:  defect      |      Status:  new   
 Priority:  major       |   Milestone:  next  
Component:  Augeas      |     Version:  0.7.0 
 Keywords:              |  
------------------------+---------------------------------------------------
 The macro `_N` is already taken by a system include on Solaris and neds to
 be renamed, e. g. to `_NULL`. The following patch solves the problem:

 {{{
 From 7f2da212368aa6eb7d4e63afaa7e8a4ab3325214 Mon Sep 17 00:00:00 2001
 From: Dagobert Michelsen <dam at opencsw.org>
 Date: Mon, 1 Mar 2010 11:55:44 +0100
 Subject: [PATCH] Do not use _N already taken on Solaris

 ---
  src/fa.c |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

 diff --git a/src/fa.c b/src/fa.c
 index b3f56d0..0c6f8b8 100644
 --- a/src/fa.c
 +++ b/src/fa.c
 @@ -46,7 +46,7 @@ typedef unsigned char uchar;

  #define _E(cond) if (cond) goto error
  #define _F(expr) if ((expr) < 0) goto error
 -#define _N(expr) if ((expr) == NULL) goto error
 +#define _NULL(expr) if ((expr) == NULL) goto error

  /* Which algorithm to use in FA_MINIMIZE */
  int fa_minimization_algorithm = FA_MIN_HOPCROFT;
 @@ -2241,7 +2241,7 @@ struct fa *fa_intersect(struct fa *fa1, struct fa
 *fa2) {
                                                         t1[n1].to,
 t2[n2].to);
                      if (r == NULL) {
                          r = add_state(fa, 0);
 -                        _N(r);
 +                        _NULL(r);
                          _F(state_set_push(worklist, t1[n1].to));
                          _F(state_set_push(worklist, t2[n2].to));
                          _F(state_set_push(worklist, r));
 @@ -2601,7 +2601,7 @@ int fa_example(struct fa *fa, char **example, size_t
 *example_len) {
              int toind = state_set_index(path, t->to);
              if (toind == -1) {
                  struct re_str *w = string_extend(NULL, ps, c);
 -                _N(w);
 +                _NULL(w);
                  _F(state_set_push(worklist, t->to));
                  _F(state_set_push_data(path, t->to, w));
              } else {
 --
 1.6.6
 }}}

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/110>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list