Subject | Compiling clients with MinGW-W64 ibase.h, STATUS and __x86_64__ |
---|---|
Author | Mike Ro |
Post date | 2016-03-30T18:53:24Z |
I have been having a problem with unexpected status returns from calls
to isc_dsql_prepare etc.
I think the problem is due to the definition of ISC_STATUS.
In ibase.h it is defined like this:
typedef intptr_t ISC_STATUS;
Where intptr_t is defined like this:
#if defined(_WIN64)
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef long intptr_t;
typedef unsigned long uintptr_t;
#endif
#endif
But MinGW-W64 does not define _WIN64, so intptr_t is not typedef'd
correctly.
Therefore I think the first line should instead be:
#if defined(_WIN64) || defined (__x86_64__)
I couldn't find this mentioned anywhere, but sorry if my searching was
not sufficient.
to isc_dsql_prepare etc.
I think the problem is due to the definition of ISC_STATUS.
In ibase.h it is defined like this:
typedef intptr_t ISC_STATUS;
Where intptr_t is defined like this:
#if defined(_WIN64)
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef long intptr_t;
typedef unsigned long uintptr_t;
#endif
#endif
But MinGW-W64 does not define _WIN64, so intptr_t is not typedef'd
correctly.
Therefore I think the first line should instead be:
#if defined(_WIN64) || defined (__x86_64__)
I couldn't find this mentioned anywhere, but sorry if my searching was
not sufficient.