Re: LPBYTE typedef in sqlfront.h and php_mssql.c
Stuart Henderson <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On 2011-06-17, [email protected] <[email protected]> wrote: > On Thu, Jun 16, 2011 at 10:14:51PM +0000, Stuart Henderson wrote: >> http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/include/sqlfront.h?r1=1.5&r2=1.6&view=patch >> >> include/sqlfront.h r1.6 added a number of typedefs for "Better Win32 >> compatibility", including this: >> >> +typedef BYTE * LPBYTE; >> >> It breaks build of php_mssql, would it be appropriate to #ifdef this? > > Microsoft's sqlfront.h conditions the typedef on DBNTWIN32. Would that > serve your purpose? > > #ifndef DBNTWIN32 > ... > typedef CHAR PTR LPSTR; > typedef BYTE PTR LPBYTE; > typedef void PTR LPVOID; > typedef const CHAR PTR LPCSTR; > > typedef int BOOL; > > #endif Ah, they're for better compatibility with source code which was written for Win32 then? Sorry I misunderstood, I thought they were something that might be needed if compiling *on* Win32. (I'm building on OpenBSD). In that case for my purposes it's probably best for me to just patch away php's typedef (it's currently in an #ifdef HAVE_FREETDS block; line 68 of http://tinyurl.com/3wlxuu), though as far as getting it fixed in PHP itself goes, they should probably being doing a proper check and seeing whether LPBYTE is already available before they typedef it. However if anyone's in the situation of building FreeTDS *on* Win32, it probably would make sense to conditionalize on DBNTWIN32. Thanks.