[PATCH] AIX BOOL conflict in tdb + largefile issue

Peter Somogyi psomogyi at gamax.hu
Thu Sep 21 09:26:24 GMT 2006

Hi Stefan,

On Wednesday 20 September 2006 19:46, Stefan (metze) Metzmacher wrote:
> we currently define BOOL_DEFINED, _BOOL_EXISTS and
> __bool_true_false_are_defined in lib/replace/replace.h
That could also cause problem because on AIX it's also defined 
in /usr/include/stdbool.h. Fortunately (!) it doesn't harm - now.
See also http://www.opengroup.org/onlinepubs/000095399/basedefs/stdbool.h.html

> > +#ifdef __bool_true_false_are_defined
> > +typedef bool BOOL;
> > +#endif

> doesn't this need to be #ifndef ?
No. Well, this is a hack. I just wanted a workaround, to detect stdbool.h 
presence (which causes _BOOL is defined but BOOL isn't.) If you have better 
idea just do it, I can help you testing.

> I just noticed that we have this in include/includes.h
> #ifndef _BOOL
> typedef int BOOL;
> #define _BOOL       /* So we don't typedef BOOL again in vfs.h */
> #endif
> does this _BOOL conflict with the stuff in the aix headers?
Yes, definitely.
_BOOL already defined but BOOL isn't. (but bool - with small letters - 
See /usr/include/stdbool.h, curses.h, term.h on AIX 5.3.
In this special case stdbool.h is included at least in tdb.c - somehow.

> or is _BOOL used there for uppercase BOOL too?
> for now I'll add exatly the above to tdbutil.h
> to consitantly typedef BOOL to int.
Didn't work for me, same error.

However, most likely I'd insert an prefix _SMB_ to each bool marco/typedef to 
avoid future conflicts. (e.g. SMB_BOOL, _SMB_BOOL and so on.)


More information about the samba-technical mailing list