I posted a message a while ago about DBI 1.15 failing to compile on HP-UX 11.0,
where it would give this message while trying to compile DBI.c:

DBI.xs: In function `dbih_make_com':
DBI.xs:696: parse error before `l'

I was able to figure out more about what was going on there by running it
through the preprocessor only, and examining the output. This is the line in
question in the original:

    DBIc_THR_USER(imp) = DBIc_THR_USER_NONE;

and this is what it becomes after preprocessing:

    ((  imp  )->com.  std.thr_user )   = (   4294967295u l     ) ;

I assume the intent was for that to be an unsigned long constant. What's the
space doing between them though?

OK, U32_MAX is being turned into that mess. Perl's handy.h turns U32_MAX into
UINT32_MAX. I go and search for that, and find this in perl.h:

#    ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
#        define UV_MAX UINT32_MAX
#    else
#        define UV_MAX 4294967295U
#    endif

Obviously Larry Wall knows something about UINT32_MAX being broken in HP-UX with
gcc :-) It seems that the Perl makefile sets -DUINT32_MAX_BROKEN in the Perl
"cppflags".

Therefore, may I suggest changing the definition of DBIc_THR_USER_NONE to
something like this:

#ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
#  define DBIc_THR_USER_NONE    (U32_MAX)
#else
#  define DBIc_THR_USER_NONE    4294967295U
#endif

With that, DBI compiles perfectly (well, except for some unused variable
warnings from gcc)..

Reply via email to