Trunk build fails with SIP 4.10.1 (API 7.1)

31.01.2011, 18:49, “Marcus D. Hanwell” mhanwell@gmail.com:

2011/1/31 Konstantin Tokarev annulen@yandex.ru;:

31.01.2011, 18:14, “Marcus D. Hanwell” mhanwell@gmail.com;:

On Mon, Jan 31, 2011 at 8:07 AM, Konstantin Tokarev annulen@yandex.ru;; wrote:

Latest SIP changes [1] completely broke compilation with SIP 4.10.1. I’ve tried to find an easy fix, but gave up for now because I don’t know SIP API well
I will take a look at this. For such a small piece of code this has
required the most maintenance. I think I have a good handle on this,
but it would be great to get a dashboard up and running with the
oldest SIP we claim to support.
AFAIU, this problem is caused from treating SIP 4.10.1 as “old” API when it has
“new” methods. SIP 4.10.1 was working before your change

Also, IIRC, SIP 4.8 worked fine too before.

Isn’t it possible to workaround this fragile APIs someway?

I began using their #define for the API versions, which is much more
robust than what we did before. I didn’t have all versions of SIP
installed though, and so it is likely there was a flaw in the logic. I
can dig through and check where things broke down.

Marcus

Constructions like these a not very understandable:

#if defined(SIP_API_MAJOR_NR) && SIP_API_MAJOR_NR == 8
sipSimpleWrapper wrapper = reinterpret_cast<sipSimpleWrapper>(obj_ptr);

if defined(SIP_API_MINOR_NR) && SIP_API_MINOR_NR >= 1

return sip_API->api_get_address(wrapper);

else

return wrapper->data;

endif

Probably these macros can make things clearer:

// Helper macro which makes easier to compare SIP API versions
#if defined(SIP_API_MAJOR_NR) && defined(SIP_API_MINOR_NR)

#define SIP_VERSION_CHECK(major, minor) ((major<<8)|(minor))
#define SIP_VERSION ((SIP_API_MAJOR_NR<<8)|(SIP_API_MINOR_NR))

#else

// For very old versions (is it really needed?)
#define SIP_VERSION_CHECK(major,minor) 1
#define SIP_VERSION 0

#endif

(the same trick as OB_VERSION_CHECK and AVOGADRO_VERSION_CHECK)

than

#if SIP_VERSION >= SIP_VERSION_CHECK(8,1)

#elif SIP_VERSION >= SIP_VERSION_CHECK(8,0)

#elif


Regards,
Konstantin