Hi Hugh,

Thanks for your reply.

Hugh McMaster писал 2022-02-19 14:11:
> Hi Lev,
> 
> Thank you for the bug report.
> 
> On Thu, 17 Feb 2022 at 04:45, Lev Lamberov wrote:
>>
>> unixodbc-dev does not ship unixodbc_conf.h (at least, on amd64 and
>> i386). The version in stable does ship it, but the version in testing
>> and unstable does not.
>>
>> It breaks builds of some packages, e. g. build of swi-prolog fails for
>> 32-bit architectures. 32-bit platforms support 64-bit integers and
>> actually all should as SWI-Prolog cannot work without them. There is a
>> suggestion that somehow SQLBIGINT is not configured correctly. More
>> specifically, the missing unixodbc_conf.h should contain either both
>> or one of
>>
>> #define HAVE_LONG_LONG 1
>> #define SIZEOF_LONG_INT 8
> 
> unixodbc_conf.h is not really intended for use by downstream packages.
> Most of the #defines it contains are internal and reflect the system
> unixodbc was compiled on.
> 
> Your build is broken because HAVE_LONG_LONG is not defined by cmake.
> This #define is needed by sqltypes.h. In general, you need to define
> this macro yourself.
> 
> I took a look at the odbc package module in swi-prolog. While
> SIZEOF_LONG_LONG is defined, the corresponding existence variable is
> HAVE_SIZEOF_LONG_LONG.
> 
> You need to patch the source in packages/ocbc/CMakeLists.txt to pass
> LONG_LONG as the second argument to check_type_size().
> 
> -check_type_size("long long" SIZEOF_LONG_LONG)
> +check_type_size("long long" LONG_LONG)
> 
> This way, HAVE_LONG_LONG is defined as true and the build completes as 
> expected.
> 
> I'll look into defining HAVE_LONG_LONG in sqltypes.h to avoid this
> problem with other packages.

I forwarded your reply to the swi-prolog upstream. Haven't tested your
suggestion yet. Hope to take a look into it a bit later.

And I think it would be great to have HAVE_LONG_LONG defined on the
side of unixodbc.

Cheers!
Lev

Reply via email to