Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 310923 - x11-libs/wxGTK[odbc] fails to compile against dev-db/unixODBC-2.2.14: bad SQLLEN definition
Summary: x11-libs/wxGTK[odbc] fails to compile against dev-db/unixODBC-2.2.14: bad SQL...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo wxWidgets project
URL: http://trac.wxwidgets.org/ticket/11856
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-23 13:57 UTC by Martin von Gagern
Modified: 2010-04-02 21:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch (gentoo310923a.patch,1.41 KB, patch)
2010-03-23 14:06 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2010-03-23 13:57:41 UTC
dev-db/unixODBC-2.2.14 changed SQLLEN and SQLULEN from #define to typedef.

wx/db.h does this:
#ifndef SQLLEN
#define SQLLEN SQLINTEGER
#endif
#ifndef SQLULEN
#define SQLULEN SQLUINTEGER
#endif

This causes a lot of errors, mostly like this:
db.cpp:1636: error: cannot convert ‘SQLINTEGER*’ to ‘SQLLEN*’ for argument ‘6’ to ‘SQLRETURN SQLGetData(void*, SQLUSMALLINT, SQLSMALLINT, void*, SQLLEN, SQLLEN*)’
...
dbtable.cpp:592: error: cannot convert ‘SQLUINTEGER*’ to ‘SQLULEN*’ for argument ‘4’ to ‘SQLRETURN SQLExtendedFetch(void*, SQLUSMALLINT, SQLLEN, SQLULEN*, SQLUSMALLINT*)’

FYI: Just fixed a similar issue in kde-sunset dev-db/qt-unixODBC:
http://git.overlays.gentoo.org/gitweb/?p=proj/kde-sunset.git;a=commitdiff;h=1c5a49baeab71f81be251fc980434eebdfc79488
There I did revbump, but I guess there should be no need to do so.
Comment 1 Martin von Gagern 2010-03-23 14:06:25 UTC
Created attachment 224895 [details, diff]
Proposed patch

This patch simply drops the whole macro definition block. It therefore causes the resulting code to rely on unixODBC versions recent enough to provide SQLLEN, and will work with dev-db/unixODBC-2.2.14.
Comment 2 Martin von Gagern 2010-03-23 15:08:28 UTC
x11-libs/wxGTK-2.8.10.1-r5 is affected as well as the x11-libs/wxGTK-2.6.4.0-r6 for which I originally reported this bug. Patch applies cleanly with some offset.
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2010-03-25 19:55:51 UTC
thanks for researching this.  i'd rather not force us to depend on any particular version if it can be avoided.  i forwarded this upstream to see if they have a better idea.
Comment 4 Martin von Gagern 2010-03-25 20:19:28 UTC
Upstream you indicated that the patch was forcing us to use >=unixODBC-2.2.14. This is wrong. SQLLEN was introduced in revision 1.4 of sqltypes.h back in 2001:
http://unixodbc.cvs.sourceforge.net/viewvc/unixodbc/unixODBC/include/sqltypes.h?view=diff&r1=1.3&r2=1.4
So that's what "versions recent enough to provide SQLLEN" from my comment #1 boils down to upon further investigation.

Since the beginning it would be defined either as a #define or as a typedef. The only thing that recently changed seems to be that the preprocessor now chooses the typedef over the #define at least on my system. Without the patch, the wxGTK code works with the #define but fails with the typedef. With my patch applied, the code works with either one, and fails if SQLLEN isn't specified in either way.

As the earliest unixODBC package present in the portage tree is 2.2.12, which according to the ChangeLog was added in 2007, I'd consider it safe to assume that it does provide SQLLEN. Checking the sources does confirm this: SQLLEN is present in the 2.2.12 sqltypes.h.

I don't know if anyone out there might conceivably have a unixODBC version from 2001 around. If so, then depending on >=2.2.12 would simply force such people to update to what portage provides these days, without imposing any severe restriction. You might as well skip this dependency, though, as anyone not updating for so long deserves having to deal with some errors caused by hopelessly outdated packages. Up to you, either one seems sane to me.
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2010-03-25 20:35:28 UTC
yeah, i misread that.  i'll apply this next time i get a chance.
Comment 6 Martin von Gagern 2010-03-25 20:38:59 UTC
Will you also update the upstream report?
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2010-04-02 21:18:38 UTC
Fixed in 2.6.4.0-r6 and 2.8.10.1-r5.