[freetds] ABI incompatible in dblib

James K. Lowden jklowden at freetds.org
Sat Feb 28 12:24:06 EST 2009


Frediano Ziglio wrote:
> > http://manuals.sybase.com/onlinebooks/group-cnarc/cng1110e/dblib/@Generic__BookTextView/15108
> >
> > I don't see any other choice.  Perhaps we need to bump the .so major?
> >
> > Good to know you're checking, Governor!  ;-)
> >
> 
> Mmmm... I was looking at new warnings, specifically those at t0012
> test. At first sight I changed %d to %ld but after a bit (luckyly) I
> realized that abi was changed so I checked in vendor headers and I
> realize they use long only if sizeof(long) == 4 (that is they use int
> if long is.. too long :) ). 

Well, hmph.  Agreed.  So much for reading the documentation.  "Do as I
say, not as I do."  Or, rather, in this case, "Do as I do, not as I say". 


On my Mac, it looks like this:

In cstypes.h, included by sybfront.h:

typedef struct _cs_daterec
{
	CS_INT		dateyear;	/* 1900 to the future */
	CS_INT		datemonth;	/* 0 - 11 */
	CS_INT		datedmonth;	/* 1 - 31 */
	CS_INT		datedyear;	/* 1 - 366 */
	CS_INT		datedweek;	/* 0 - 6 (Mon. - Sun.) */
	CS_INT		datehour;	/* 0 - 23 */
	CS_INT		dateminute;	/* 0 - 59 */
	CS_INT		datesecond;	/* 0 - 59 */
	CS_INT		datemsecond;	/* 0 - 997 */
	CS_INT		datetzone;	/* 0 - 127 */
} CS_DATEREC;

In sybfront.h:
#define	DBDATEREC	CS_DATEREC

I'll revert the Sybase-style names to 32-bit.  

--jkl


More information about the FreeTDS mailing list