[Opendnssec-develop] Building Enforcer-ng on Solaris

Yuri Schaeffer yuri at NLnetLabs.nl
Tue Sep 20 08:20:08 UTC 2011


Hi all,

Unfortunately we haven't been able to build the Enforcer-ng branch on
Solaris yet. As far as we can tell it is because of the mixing of C and
C++, this gives us problems in case of LDNS.

In file included from /d/home/yuri/ldns/include/ldns/ldns.h:95,
                 from ./scheduler/task.h:40,
                 from ./daemon/worker.h:37,
                 from ./daemon/engine.h:40,
                 from ./policy/update_kasp_cmd.h:4,
                 from policy/update_kasp_cmd.cpp:6:
/d/home/yuri/ldns/include/ldns/util.h:210: error: `_Bool' has not been
declared
/d/home/yuri/ldns/include/ldns/util.h:210: error: ISO C++ forbids
declaration of `value' with no type

(note that line numbers may be different in your copy)

Use of bool in mixed code is problematic. Therefore ldns' common.h
includes the following. It defines _Bool for C++.

#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# ifndef HAVE__BOOL
#  ifdef __cplusplus
typedef bool _Bool;
#  else
#   define _Bool signed char
#  endif
# endif
# define bool _Bool
# define false 0
# define true 1
# define __bool_true_false_are_defined 1
#endif

BUT, HAVE_STDBOOL_H and HAVE__BOOL are defined. Configure checked this,
but of course only for C and not for C++. The first one is correct, C++
has (a rather empty) stdbool.h, the second isn't in our case.

A solution is to insert in the above snippet between the 2nd and 3th line:

# ifndef _Bool
#  define _Bool signed char
# endif

It seems rather harmless for other projects using ldns. But I don't
think it is acceptable modify ldns. However it is the only thing that
worked so far (then, ODS still wont compile but I haven't got to that
part yet). Any ideas are welcome, or anyone willing to give it a try,
I'm afraid I do not have anymore configure-fu left...

//Yuri


-- 
Yuri Schaeffer
NLnet Labs
http://www.nlnetlabs.nl



More information about the Opendnssec-develop mailing list