Re: ABI incompatible in dblib

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.