#429 ✓resolved
vo.x

[PATCH] do_sqlite3-0.9.2 compile fails under cygwin

Reported by vo.x | July 17th, 2008 @ 04:06 PM

Hello,

I have found ticket #344 which describes similar problems with do_mysql on solaris. I applied the same patch for do_sqlite in recent version.

do_sqlite3_ext.c:
155,156c155,157
< 	time_t rawtime;
< 	struct tm * timeinfo;
---
> 	long gmtoffset;
> 	time_t t1, t2;
> 	struct tm tm;
178,181c179,184
< 		// Get localtime
< 		time(&rawtime);
< 		timeinfo = localtime(&rawtime);
< 	
---
> 		// begin ANSI GMT offset caluclation
> 		t1 = time(0);
> 		tm = *gmtime(&t1);
> 		t2 = mktime(&tm);
> 		gmtoffset = (long) difftime(t1, t2);
> 
184,186c187,189
< 		hour_offset = abs(timeinfo->tm_gmtoff) / 3600;
< 		minute_offset = abs(timeinfo->tm_gmtoff) % 3600 / 60;
< 		sign = timeinfo->tm_gmtoff < 0 ? '-' : '+';
---
> 		hour_offset = abs(gmtoffset) / 3600;
> 		minute_offset = abs(gmtoffset) % 3600 / 60;
> 		sign = gmtoffset < 0 ? '-' : '+';

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Pages