Skip to Content.
Sympa Menu

freetds - Re: [freetds] LPBYTE typedef in sqlfront.h and php_mssql.c

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stuart Henderson <stu AT spacehopper.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] LPBYTE typedef in sqlfront.h and php_mssql.c
  • Date: Fri, 17 Jun 2011 21:13:11 +0000 (UTC)

On 2011-06-17, jklowden AT freetds.org <jklowden AT freetds.org> 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.






Archive powered by MHonArc 2.6.24.

Top of Page